#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL <<60;
const long long  MOD = 1000000007;
typedef long long ll;
using namespace std;

ll gcd(ll m,ll n){
    if(n==0) return m;
    return gcd(n,m%n);
}
         
int main(){
    int a,b;
    cin >> a >> b;

    int ans;

    rep(i,1,b){
        int tmp = 0;
        if(b / i > 1) tmp = b / i;
        else break;

        if(i * (tmp - 1) >= a && i * (tmp - 1) <= b) ans = i;
    }

    cout << ans << endl;

    return 0;
} 
#include<iostream>
#include<bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
#define DEB(x)	cout << #x << " " << x << endl;
#define DEB_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

typedef long long int LL;
typedef pair<int, int> PI;
typedef pair<LL, LL> PLL;
typedef pair<int, PI> PPI;

typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<vector<int>> VVI;


void solve() {
	int a, b;
	cin >> a >> b;

	FORR(i, 1, b) {
		int ra = max(i, a);
		int k =  ra / i;
		int proda = i*k;

		if (proda < a)
			proda = i*(++k);

		if (proda > b)
			continue;

		int prodb = i*(k+1);
		if (prodb >= a && prodb <= b) {
			cout << i << endl;
			return;
		}
	}
}

int main() {

	IOS

	// int t;
	// cin >> t;

	// while (t--) {
	    solve();
	// }

	return 0;
}