#include <bits/stdc++.h>
#define loop(n) for(ll i=0;i<n;i++)
#define loopj(n) for(ll j=0;j<n;j++)
#define loopR(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define rng(i,a,b,c) for(ll i = a; i<b;i+=c)
#define loop2(i,a,b) for(long long i = a; i>=b;i--)
#define loop3(j,a,b) for(int j = a; j<b;j++)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long   
#define ld long double
#define SET set<ll>
#define pb push_back
#define mp make_pair
#define gc getchar_unlocked
#define in ll n;cin>>n;
#define all(s) s.begin(),s.end()
 
ll mod=pow(10,9)+7;
using namespace std; 
//--------------------------\\
//code once think twice
 
 
ll gcd(ll a,ll b)
{
	if(b==0)
	return a;
	
	return gcd(b,a%b);
}
 
 
void go()
{
	ll n,s=0;
	
	cin>>n;
	
	ll a[n],b[n];
	
	loop(n)
	cin>>a[i];
	loop(n)
	{
	cin>>b[i];
	s+=a[i]*b[i];
	}
	
	if(s==0)
	cout<<"Yes";
	else
	cout<<"No";
	
}
	
 
  
int main() 
{ 
    
int t; 
 
fast;
//cin>>t; 
// 
//loop(t)
go();
}
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+50;
int a[N],b[N];
int main()
{
	int n;scanf("%d",&n);
	for(int i=1;i<=n;i++)	scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)	scanf("%d",&b[i]);
	int flag=0;
	for(int i=1;i<=n;i++)
	{
		flag+=a[i]*b[i];
	}
	if(flag)	puts("No");
	else		puts("Yes");
	return 0;
}