#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
 int n,sum=0; string ans;
 cin >> n;
 int *a = new int[n];
 int *b = new int[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) sum+=a[i]*b[i];
 

 if(sum==0)ans="Yes";else ans="No";
 cout << ans << endl;
 return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define MAX 1000002
#define MOD 1e9 + 7
#define pb push_back
#define w(t) while(t--)
#define ff(i,a,b) for(int i=a;i<b;i++)
#define ffe(i,a,b) for(int i=a;i<=b;i++)
#define fbe(i,b,a) for(int i=b;i>=a;i--)
#define fb(i,b,a) for(int i=b;i>a;i--)
#define vi vector<int>
#define vll vector<ll>
#define all(a) a.begin(),a.end()
#define elif else if
void FAST_IO()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}
void solve(){
    int n,sum=0;
    cin>>n;
    int arr1[n];
    int arr2[n];
    ff(i,0,n)
    cin>>arr1[i];
    ff(j,0,n)
    cin>>arr2[j];
    ff(i,0,n)
    sum+=(arr1[i]*arr2[i]);
    if(sum==0)
    cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
int main()
{
	FAST_IO();
	/*int t=1;
	cin>>t;
	w(t)*/
	solve();
}