#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#define gp  __gnu_pbds
#define iset(T) gp::tree<T,gp::null_type,less<T>,gp::rb_tree_tag,gp::tree_order_statistics_node_update>
using namespace std;

#define SQ(x) ((x)*(x))
#define u unsigned
#define ull unsigned long long
#define ll  long long
#define ld  long double
#define test(x) cout<<"here "<<x<<endl;
#define debug(x) cout<<(#x)<<": "<<(x)<<endl;
#define inputstl(v) for(auto& x:v) cin>>x;
#define input(arr,n) for(ull i=0;i<n;++i){cin>>arr[i];}
#define print(arr,n) for(ull i=0;i<n;++i){cout<<arr[i]<<" ";}cout<<'\n';
#define printall(x) for(auto y:x){cout<<y<<' ';}cout<<'\n';
#define printallpii(x) for(auto y:x){cout<<y.fi<<','<<y.se<<' ';}cout<<'\n';
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define mod (ll)(1e9+7)
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define SENSITIVITY 1e-9
#define EQUAL(x1,x2) [](auto x1,auto x2){double ep=0.0001;double pos=x1-x2;if(pos<0){pos=-pos;}double maxi=(x1>x2)?(x1):(x2);if(pos/(maxi*ep)<SENSITIVITY)return true;else return false;}(x1,x2)
bool isPrime(ll a)
{
    ll lim=sqrt(a);
    lim++;
    if(a==1)
        return false;
    for(ll i=2; i<=lim; ++i)
    {
        if(a%i==0)
        {
            return false;
        }
    }
    return true;
}
bool isPali(string s)
{
    int _size=(s.length())/2;
    for(int i=0; i<_size; ++i)
    {
        if(s.at(i)!=s.at(s.length()-1-i))
        {
            return false;
        }
    }
    return true;
}
int gcd(int a,int b)
{
    if(a==0)
    {
        return b;
    }
    else if(b==0)
    {
        return a;
    }
    else
    {
        int shift=__builtin_ctz(a|b);
        a>>=__builtin_ctz(a);
        do
        {
            b>>=__builtin_ctz(b);
            if(a>b)
            {
                a=a^b;
                b=a^b;
                a=a^b;
            }
            b-=a;
        }
        while(b);
        return a<<shift;
    }
}
ll gcdll(ll a,ll b)
{
    if(a==0)
    {
        return b;
    }
    else if(b==0)
    {
        return a;
    }
    else
    {
        ll shift=__builtin_ctzll(a|b);
        a>>=__builtin_ctzll(a);
        do
        {
            b>>=__builtin_ctzll(b);
            if(a>b)
            {
                a=a^b;
                b=a^b;
                a=a^b;
            }
            b-=a;
        }
        while(b);
        return a<<shift;
    }
}

ll power(ll a,ll b,ll _mod)
{
    ll temp=a;
    ll ans=1;
    int limit=63-__builtin_clzll(b);
    int index=0;
    while(index<=limit)
    {
        if(b&(1ll<<index))
        {
            ans=(ans*temp)%_mod;
        }
        ++index;
        temp=(temp*temp)%_mod;
    }
    return ans;
}



int main()
{
    fastio;
    int tt=1;
//    cin>>tt;
    while(tt--)
    {
        int n;
        cin>>n;
        vector<ll> a(n),b(n);
        inputstl(a);
        inputstl(b);
        ll 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;
}

#include<iostream>
using namespace std;
int n,a[100020],b[100020],s=0;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=n;i++)
	{
		cin>>b[i];
		s+=a[i]*b[i];
	}
	cout<<(s?"No":"Yes")<<endl;
	return 0;
}