#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 

int main()
{
    ll n,i,x,y,ans=0;
    cin >> n;
    
    ll a[n],b[n];
    for(i=0;i<n;i++)
        cin >> a[i];
    
    for(i=0;i<n;i++)
        cin >> b[i];
        
    for(i=0;i<n;i++)
    {
        ans += a[i]*b[i];
    }
    if(ans == 0)
        std::cout << "Yes" << std::endl;
    else
        cout << "No" << "\n";

    return 0;
}





#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define deb(x) cout << #x << "=" << x << endl
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
int M=1e9+7,N=205001;

int mm(int x,int y){x%=M,y%=M;return (x*y)%M;}//Modular Multiply
int po(int x,int y){ if(!y)return 1;int a=po(x,y/2)%M;if(y%2)return mm(a,mm(a,x));return mm(a,a);}//(x**y)%M



void solve() {
	int n,x,s=0;
	cin>>n;
	int a[n];
	rep(i,0,n) cin>>a[i];
	rep(i,0,n) {
		cin>>x;
		s+=a[i]*x;
	}
	if(s) cout<<"No";
	else cout<<"Yes";
}


signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}



