#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e) {
  cout << e << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int dp[110][15], n, m;
int solve(int ind, int mod) {
  if (ind == n) return mod == 0;
  int &ret = dp[ind][mod];
  if (ret != -1) return ret;
  ret = 0;
  int i;
  if (ind == 0) {
    for (i = 1; i <= 9; i++) {
      ret = max(ret, solve(ind + 1, i % m));
      if (ret) return ret;
    }
  } else {
    for (i = 0; i < 10; i++) {
      ret = max(ret, solve(ind + 1, (mod * 10 + i) % m));
      if (ret) return ret;
    }
  }
  return ret;
}
void solve2(int ind, int mod) {
  if (ind == n) return;
  int ret;
  ret = 0;
  int i;
  if (ind == 0) {
    for (i = 1; i <= 9; i++) {
      ret = max(ret, solve(ind + 1, i % m));
      if (ret) {
        cout << i;
        solve2(ind + 1, i % m);
        return;
      }
    }
  } else {
    for (i = 0; i < 10; i++) {
      ret = max(ret, solve(ind + 1, (mod * 10 + i) % m));
      if (ret) {
        cout << i;
        solve2(ind + 1, (mod * 10 + i) % m);
        return;
      }
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int i, j;
  memset(dp, -1, sizeof(dp));
  cin >> n >> m;
  if (!solve(0, 0)) {
    deb(-1);
    return 0;
  }
  solve2(0, 0);
  return 0;
}
