#include<iostream>
#include<cstdio>
#include<cassert>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<vector> 
#include<cstring>
#include<string>
#include<map>
#include<set>

#define mp make_pair
#define scn second
#define frs first
#define pb push_back

#define NAME "capital"

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, int> pi;
const int P = 239017;
const ll INF = 10000000000000000ll;

int n, k;

int main(){
    freopen(NAME ".in", "r", stdin); 
    freopen(NAME ".out", "w", stdout); 
    int sum;
    scanf("%d%d", &sum, &n);
    if (n * 9 < sum) {
    	printf("-1");
    	return 0;
    }
    for (int i = 0; i < sum / 9; ++i) {
    	printf("9");
    	--n;
    }
    printf("%d", sum % 9);
    --n;
    for (; n > 0; --n) 
    	printf("0");
    return 0;
}
