#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define deb(x) cout<<#x<<" "<<x<<endl;
#define print(arr,n) for(int i=0;i<n;++i) { cout<<arr[i]<<" "; } cout<<endl;
#define ub(x,el) upper_bound(x.begin(),x.end(),el) - x.begin()
#define lb(x,el) lower_bound(x.begin(),x.end(),el) - x.begin();
#define bs(x,el) binary_search(x.begin(),x.end(),el)
#define MOD 1000000007
#define finish return 0
#define all(x) x.begin(),x.end()
using namespace std;
using namespace __gnu_pbds; 
typedef long long int ll;
typedef tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
template<int D, typename T> struct Vec : public vector<Vec<D - 1, T>> { static_assert(D >= 1, "Vector dimension must be greater than zero!"); template<typename... Args> Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) { }}; template<typename T> struct Vec<1, T> : public vector<T> { Vec(int n = 0, T val = T()) : vector<T>(n, val) { } };
inline ll mod(const ll& x) { return (x%MOD + MOD)%MOD; }
ll gcd(ll a, ll b, ll &x, ll &y){if(a == 0){x = 0, y = 1; return b;} ll x1, y1;  ll d = gcd(b%a, a, x1, y1); x = y1 - (b/a) * x1; y = x1; return d;}
ll power(ll x,ll y, ll p) { ll res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res*x) % p; y = y>>1; x = (x*x) % p;   } return res; } 
ll power(ll x,ll y) { ll res = 1; while (y > 0) { if (y & 1) res = (res*x); y = y>>1; x = (x*x);   } return res; } 
ll mod(ll num, ll den){ return mod(mod(num) * power(den,MOD-2,MOD)); }
vector<ll> primes(ll n) { vector<ll> p; vector<bool> v(n+1,true); for(ll i=2;i*i<=n;++i) { if(v[i]) { for(ll j=i*i;j<=n;j+=i) v[j] = false; } } for(ll i=2;i<=n;++i) if(v[i]) p.push_back(i); return p; }
vector<ll> lpf(ll n){ vector<ll> v(n+1); for(ll i=1;i<=n;++i) v[i] = i; for(ll i=2;i*i<=n;++i) { if(v[i] == i) { for(ll j=i*i;j<=n;j+=i) { v[j] = i; } } } return v; }
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> b(n);
    for(auto& i:a) cin>>i;
    for(auto& i:b) cin>>i;
    ll sum = 0;
    for(ll i=0;i<n;++i)
    {
        sum += a[i] * b[i];
    }
    if(sum == 0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    

}
#include<stdio.h>
int main()
{
	int N,a[100000],b[100000],i,c=0;
	scanf("%d",&N);
	for(i=0;i<N;i++)
	    scanf("%d",&a[i]);
	for(i=0;i<N;i++)
	{   scanf("%d",&b[i]);
	c=a[i]*b[i]+c;}
	if(c==0)
		printf("Yes");
	else printf("No");
	return 0;
}
