#include <cmath>
#include <iostream>

using namespace std;
using ll = long long;

int main (int argc, char* argv[]) {
  ll s, p;
  cin >> s >> p;

  auto flag = false;

  for (auto i = 1; i < sqrt (p + 1); i++) {
    auto j = p / i;
    if (i * j != p) continue;
    if (i + j == s) {
      flag = true;
      break;
    }
  }

  cout << (flag ? "Yes" : "No") << endl;

  return 0;
}

/**
 * author: BueVonHun 🐼🎋
 * More Info: https://github.com/Bue-von-hon
**/

#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <cstring>
#include <cmath>
#include <tuple>
#include <set>
#include <map>
#include <bitset>
#include <sstream>

typedef long long ll;
using namespace std;

#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
#define mp make_pair
#define pii pair<int,int>
#define piii pair<int,pii>
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define X first
#define Y second

#define rep(i, n) for (register int i = 0; i < (n); i++)

template <class T> T _min(T a,T b){return (a<b ? a : b);}
template <class T> T _max(T a,T b){return (a>b ? a : b);}
template<class T> void read(T& x) {cin >> x;}
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) { if (a == 0 || b == 0)return a + b; return a / GCD(a, b) * b; }

vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
//#define XOX;
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
int INF = numeric_limits<int>::max();
int mod=1e9+7;

inline ll power(ll a, ll n) {
    if (n==1) return a;
    if (n==0) return 1;
    ll ret=1;
    if (n%2!=0) ret=(ret*a)%mod;
    ll tmp = power(a, n/2);
    ll tmp2 = tmp*tmp%mod;
    return (ret*tmp2)%mod;
}
inline int MOD(long long n){
    if(n >= 0) return n % mod;
    return ((-n/mod+1)*mod + n) % mod; // 음수일 경우
}
vt<int> A, B;
int main(void) {
    fast_cin();
    int n;read(n);

    rep(i, n) {
        int tmp;read(tmp);
        A.pb(tmp);
    }
    rep(i, n) {
        int tmp;read(tmp);
        B.pb(tmp);
    }
    ll ans = 0;
    rep(i, n) {
        ans += A[i]*B[i];
    }
    if (ans==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
