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

#define f(t) ll t; cin>>t; while(t--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define vec vector<ll>
#define vecpair vector<pair<ll,ll>>

using ll = long long;
using ld = long double;

const int N = 2e5 + 5;

int main(){
    IOS;
    int n,product=0;
    cin>>n;
    vector<int>a(n),b(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        cin>>b[i];
    }
    for(int i=0;i<n;i++){
        product+=a[i]*b[i];
    }
    if(product==0){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pp pop_back
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define f0(i,a,n) for(i=a;i<n;i++)
#define f1(i,a,b) for(i=a;i<=b;i++)
#define all(v) sort(v.begin(),v.end());
#define stp setprecision
#define nl endl
#define I insert
#define ipt(a,n) for(i=0;i<n;i++)cin>>a[i];
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vl vector<ll>
#define mp map<ll,ll>
#define sr(a,n) sort(a,a+n);
#define cx(x) cout<<x<<"\n";
#define cy(x) cout<<x<<" ";
#define cn cout<<"No\n";
#define cw cout<<"Yes\n";
#define bs binary_search
#define S second
#define F first
#define pi 3.141592653589793238
#define ct cout<<
ll sieve[1000001];
void prime()
{
    ll i,j;
    sieve[0]=0,sieve[1]=0;
    for(i=2;i<=1e6;i++)
        sieve[i]=1;
    for(i=2;i<=1e6;i++)
    {
        if(sieve[i]==1)
        {
            for(j=2*i;j<=1e6;j+=i)
                sieve[j]=0;
        }
    }
}
ll be(ll a,ll b,ll m)
{
    ll r=1;
    while(b!=0)
    {
        if(b&1)
            r=(r*a)%m;
        a=(a*a)%m;
        b=b/2;
    }
    return r;
}

int main()
{
    fast;
    //prime();
   
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll a[n],b[n],i,s=0;
        ipt(a,n);
        ipt(b,n);
        f0(i,0,n)
        s+=a[i]*b[i];
        if(!s)
            cw
        else
            cn
    }
}
