#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,s,n) for (int i = (s); i < (n); ++i)
#define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define len(x) (int)(x).size()
#define dup(x,y) (((x)+(y)-1)/(y))
#define pb push_back
#define eb emplace_back
#define Field(T) vector<vector<T>>
#define pq(T) priority_queue<T,vector<T>,greater<T>>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  int x = 0;
  vector<int> a(n);
  rep(i,0,n) cin >> a[i];
  rep(i,0,n) {
    int b;
    cin >> b;
    x += a[i]*b;
  }
  if (x == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
#include<iostream>
#include<bits/stdc++.h>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    vector<int> B(N);
    for(int i=0; i<N; i++) cin >> A[i];
    for(int i=0; i<N; i++) cin >> B[i];

    int sum=0;
    for(int i=0; i<N; i++){
        sum += A[i]*B[i];
    }
    if(sum==0)  cout << "Yes" << endl;
    else        cout << "No" << endl;

    return 0;
}