#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; ll mpow(ll a, ll b, ll mod){ ll ans = 1; while (b){ if (1 & b) ans = ans * a % mod; a = a * a % mod; b >>= 1; } return ans; } int main() { ll a, b, mod = 998244353; cin >> a >> b; cout << ((mpow(a, b, mod) == mpow(b, a, mod)) ? "Yes" : "No") << endl; }