#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template<class T> bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b){if(a<b) {a = b; return true;} return false;}
#define rep(i,n) for(int i=0;i<(n);i++)
#define drep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cerr << #x << " = " << (x) << endl;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vec<ll> A(N),B(N);
    rep(i,N) cin >> A[i];
    rep(i,N) cin >> B[i];
    ll sum = 0;
    rep(i,N) sum += A[i]*B[i];
    cout << (sum? "No\n":"Yes\n");
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  int x[n];
  int y[n];
  for(int i=0;i<n;i++)
  {
    cin >> x[i];
  }
  for(int j=0;j<n;j++)
  {
    cin >> y[j];
  }
  int mul[n];
  int sum=0;
  for(int p=0;p<n;p++)
   {
     mul[p]=x[p]*y[p];
   } 
   for(int o=0;o<n;o++)
   {
      sum=sum+mul[o];
    }
  if(sum==0)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}
