#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#include<functional>
#include<iomanip>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define chartoint(c) (int)((c) - '0')
#define chartoll(c) (long long)((c) - '0')
#define bpc(x) __builtin_popcount(x)
#define bpcll(x) __builtin_popcountll(x)
#define fps(n) fixed << setprecision(n)
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define cotu cout
#define Endl endl
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> A(n);
    vector<ll> B(n);
    rep(i,0,n) cin >> A[i];
    rep(i,0,n) cin >> B[i];
    ll sum = 0LL;
    rep(i,0,n) sum += A[i]*B[i];
    if(sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    std::fstream myfile("D:\\CodeBlocks\\c++\\input.txt.c", std::ios_base::in);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n;
    cin>>n;
    
    
    vector<ll> vec(n);
    
    for(ll i=0;i<n;i++){
        cin>>vec[i];    
    }
    ll sum=0;
    for(ll i=0;i<n;i++){
        ll temp;
        cin>>temp;
        sum+=(vec[i]*temp);
    }
    if(sum==0)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    
    return 0;
}

