#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define BE(x) x.begin(), x.end()

int main() {
    int a, b;
    cin >> a >> b;

    int ans = 1;
    for (int i = 2; i <= b; i++) {
        if (b/i - (a-1)/i >= 2) ans = i;
    }

    cout << ans << endl;
}
#include <iostream>
#include <algorithm>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void)
{
    ll s, p, div;

    scanf("%lld%lld", &s, &p);
    for (div = 1; div * div <= p; div++)
    {
        if (p % div == 0 && div + p / div == s)
        {
            printf("Yes\n");
            return (0);
        }
    }
    printf("No\n");

    return (0);
}