#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  int c;
  vector<vector<int>> a(n, vector<int>(2));
  for(int i = 0; i < 2*n; i++){
    cin >> a.at(i % n).at(i / n);
  }
  for(int i = 0; i < n; i++){
    c += a.at(i).at(0) * a.at(i).at(1);
  }
  if ( c == 0){
    cout << "Yes" << endl;
  }
  else{
    puts("No");
  }
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;


void solve() {
    ll n;
    cin >> n;

    vector<ll> a(n), b(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    
    for (int i = 0; i < n; i++)
        cin >> b[i];

    ll ans = 0;
    for (int i = 0; i < n; i++)
        ans += a[i]*b[i];
    
    if (ans == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}


int main() {
    ll t;
    // cin >> t;
    t = 1;
    while (t--)
        solve();
}
