#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef long double ld;
//#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define rev(i,b,a)  for (ll i = b - 1; i >= a; i--)
#define all(v)      (v).begin(), (v).end()
#define maxe(v)     *max_element(v.begin(), v.end())
#define mine(v)     *min_element(v.begin(), v.end())
#define pb          push_back
#define pf          push_front
#define mp          make_pair
#define FF          first
#define SS          second
#define REM         1000000007
#define cont        continue
#define PI          3.141592653589793238462643383279502
//#define debug(n1) cout<<"debug... "<<n1<<"\n"
//const ll INF=(1ll<<60)-1;//ll ans = 3e18 + 5;
//const int N=2e5+10;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bool isprime(ll n){
    if(n%2==0 && n!=2)return false;
    for(ll i=3;i*i<=n;i+=2){
        if(n%i==0)return false;
    }
    return true;
}



int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);


   int tc=1;
   //cin>>tc;
    while(tc--){
           ll n;
           cin>>n;
           ll a[n],b[n];
           rep(i,0,n){cin>>a[i];}
           rep(i,0,n){cin>>b[i];}

           ll sum=0;

           rep(i,0,n){
                sum+=(a[i]*b[i]);
           }

           if(sum==0){cout<<"Yes\n";}
           else{cout<<"No\n";}

    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
ll pwr(ll a, ll b){
  ll res=1;
  while(b>0){
   if(b&1)
    res=res*a;
   a*=a;
   b>>=1;
  }
  return res;
  }
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  ll sum=0;
  for(int i=0;i<n;i++)
  {
     cin>>a[i];
  }
  for(int i=0;i<n;i++)
  {
     cin>>b[i];
  }
  for(int i=0;i<n;i++)
  {
     sum+=a[i]*b[i];
  }
  if(sum==0)
  cout<<"Yes\n";
  else cout<<"No\n";
 return 0;
}

