#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main() {
 	freopen("capital.in", "r", stdin);
	freopen("capital.out", "w", stdout);
	
	int a, n;
	cin >> a >> n;
	string ans = "";
	for (int i = 0; i < n; i++) {
	 	ans += (char)('0' + min(a, 9));
		a -= min(a, 9);
	}
	if (a) cout << -1 << endl;
	else cout << ans << endl;

	return 0;
}