#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i:x){cout << i << " ";} cout << endl;}
#define isin(x,l,r) ((l)<=(x) && (x)<(r))
using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<typename T>bool chmin(T&x,const T&y) {if(x>y){x=y;return true;} else return false;}
template<typename T>bool chmax(T&x,const T&y) {if(x<y){x=y;return true;} else return false;}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    vector<int> B(N);
    rep(i, N) cin >> B[i];
    if (inner_product(A.begin(), A.end(), B.begin(), 0)) puts("No");
    else puts("Yes");
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    long long N,ans;
    string yn;
    cin >> N;
    ans = 0;
    vector<int> A(N);
    vector<int> B(N);
    rep(i,N) cin >> A.at(i);
    rep(i,N) cin >> B.at(i);
    for(int j = 0; j < N; j++){
        ans += A[j] * B[j];
    }
    if(ans == 0) yn = "Yes";
    else yn = "No"; 
    cout << yn << endl;
}