#include <iostream>
using namespace std;

int main() {
	
	long long a, b;
	cin >> a >> b;
	bool flag = false;
	for (long long i = 1; i <= b / i; i ++) {
		if (b % i == 0) {
			if (b / i + i == a) {
				flag = true;
				break;
			}
		}
	}
	if (flag) cout << "Yes";
	else cout << "No";
	return 0;
	
}
#include <bits/stdc++.h>
using namespace std;

#define MAX( a , b )    ( a > b ) ? a : b
#define MIN( a , b )    ( a < b ) ? a : b

using ull = unsigned long long;
using ll = long long;
using ul = unsigned long;

int main(){
    ull A,B;
    ull result = 0;

    cin >> A >> B;
    ull C = B - A;

    for(ull i = C; i > 0; i--){
        ull j = B % i;
        ull k = B - j;
        if((k - i) >= A){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}