#include <bits/stdc++.h>
using namespace std;
bool secdes(const pair<long long int, long long int>& a,
            const pair<long long int, long long int>& b) {
  if (a.second == b.second) {
    return a.first > b.first;
  } else {
    return a.second > b.second;
  }
}
bool sir(const pair<long long int, long long int>& a,
         const pair<long long int, long long int>& b) {
  if (a.first == b.first) {
    return a.second > b.second;
  } else {
    return a.first > b.first;
  }
}
bool bysec(const pair<long long int, long long int>& a,
           const pair<long long int, long long int>& b) {
  if (a.second == b.second) {
    return a.first < b.first;
  } else {
    return a.second < b.second;
  }
}
const long long int no = 3e6 + 5;
const long long int modulo = 1e9 + 7;
const long long int N = 2001;
long long int ar[no + 10], br[no + 10], mat[N][N];
long long int dx[] = {-1, 0, 1, 0};
long long int dy[] = {0, 1, 0, -1};
char dc[] = {'L', 'D', 'R', 'U'};
long long int mul(long long int x, long long int y, long long int mod) {
  return ((x % mod) * (y % mod)) % mod;
}
long long int powwmod(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  while (y) {
    if (y & 1) {
      y--;
      res = mul(res, x, mod);
      res %= mod;
    } else {
      y /= 2;
      x = mul(x, x, mod);
      x %= mod;
    }
  }
  return res % mod;
}
long long int poww(long long int x, long long int y) {
  long long int res = 1;
  while (y) {
    if (y % 2) {
      y--;
      res = res * x;
    } else {
      y /= 2;
      x = x * x;
    }
  }
  return res;
}
long long int div(long long int x, long long int y, long long int mod) {
  return (x * powwmod(y, mod - 2, modulo)) % mod;
}
long long int add(long long int x, long long int y, long long int mod) {
  return (x % mod + y % mod) % mod;
}
bool comp(long long int x, long long int y) { return (x < y); }
long long int gcd(long long int x, long long int y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long int lcm(long long int x, long long int y) {
  return (x * y) / gcd(x, y);
}
vector<long long int> adj[no];
long long int used[no], color[no], parent[no];
long long int ans = 0, ans2 = 1, vis[N][N], n = 0;
vector<pair<long long int, long long int>> st, endd, temp;
string s[N];
bool is(long long int n, long long int p) {
  for (long long int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (i > p)
        return 1;
      else
        return 0;
    }
  }
  return 1;
}
void solve() {
  long long int m = 0, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0, w = 0, k = 0;
  cin >> a >> y;
  for (long long int i = y; i > a; i--) {
    if (is(i, a)) {
      cout << i;
      return;
    }
  }
  cout << -1;
}
inline void runn() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
}

### Prompt

Please formulate a CPP solution to the following problem:

The weather is fine today and hence it's high time to climb the nearby pine and enjoy the landscape.

The pine's trunk includes several branches, located one above another and numbered from 2 to y. Some of them (more precise, from 2 to p) are occupied by tiny vile grasshoppers which you're at war with. These grasshoppers are known for their awesome jumping skills: the grasshopper at branch x can jump to branches <image>.

Keeping this in mind, you wisely decided to choose such a branch that none of the grasshoppers could interrupt you. At the same time you wanna settle as high as possible since the view from up there is simply breathtaking.

In other words, your goal is to find the highest branch that cannot be reached by any of the grasshoppers or report that it's impossible.

Input

The only line contains two integers p and y (2 ≤ p ≤ y ≤ 109).

Output

Output the number of the highest suitable branch. If there are none, print -1 instead.

Examples

Input

3 6


Output

5


Input

3 4


Output

-1

Note

In the first sample case grasshopper from branch 2 reaches branches 2, 4 and 6 while branch 3 is initially settled by another grasshopper. Therefore the answer is 5.

It immediately follows that there are no valid branches in second sample case.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
bool secdes(const pair<long long int, long long int>& a,
            const pair<long long int, long long int>& b) {
  if (a.second == b.second) {
    return a.first > b.first;
  } else {
    return a.second > b.second;
  }
}
bool sir(const pair<long long int, long long int>& a,
         const pair<long long int, long long int>& b) {
  if (a.first == b.first) {
    return a.second > b.second;
  } else {
    return a.first > b.first;
  }
}
bool bysec(const pair<long long int, long long int>& a,
           const pair<long long int, long long int>& b) {
  if (a.second == b.second) {
    return a.first < b.first;
  } else {
    return a.second < b.second;
  }
}
const long long int no = 3e6 + 5;
const long long int modulo = 1e9 + 7;
const long long int N = 2001;
long long int ar[no + 10], br[no + 10], mat[N][N];
long long int dx[] = {-1, 0, 1, 0};
long long int dy[] = {0, 1, 0, -1};
char dc[] = {'L', 'D', 'R', 'U'};
long long int mul(long long int x, long long int y, long long int mod) {
  return ((x % mod) * (y % mod)) % mod;
}
long long int powwmod(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  while (y) {
    if (y & 1) {
      y--;
      res = mul(res, x, mod);
      res %= mod;
    } else {
      y /= 2;
      x = mul(x, x, mod);
      x %= mod;
    }
  }
  return res % mod;
}
long long int poww(long long int x, long long int y) {
  long long int res = 1;
  while (y) {
    if (y % 2) {
      y--;
      res = res * x;
    } else {
      y /= 2;
      x = x * x;
    }
  }
  return res;
}
long long int div(long long int x, long long int y, long long int mod) {
  return (x * powwmod(y, mod - 2, modulo)) % mod;
}
long long int add(long long int x, long long int y, long long int mod) {
  return (x % mod + y % mod) % mod;
}
bool comp(long long int x, long long int y) { return (x < y); }
long long int gcd(long long int x, long long int y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long int lcm(long long int x, long long int y) {
  return (x * y) / gcd(x, y);
}
vector<long long int> adj[no];
long long int used[no], color[no], parent[no];
long long int ans = 0, ans2 = 1, vis[N][N], n = 0;
vector<pair<long long int, long long int>> st, endd, temp;
string s[N];
bool is(long long int n, long long int p) {
  for (long long int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (i > p)
        return 1;
      else
        return 0;
    }
  }
  return 1;
}
void solve() {
  long long int m = 0, a = 0, b = 0, c = 0, x = 0, y = 0, z = 0, w = 0, k = 0;
  cin >> a >> y;
  for (long long int i = y; i > a; i--) {
    if (is(i, a)) {
      cout << i;
      return;
    }
  }
  cout << -1;
}
inline void runn() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
}

```