#include<bits/stdc++.h>
using namespace std;

void solve(long long*arr1 , long long*arr2 , long long n)
{
long long sum = 0;
for(int i = 0 ; i < n ; i++)
{
    sum+=(arr1[i]*arr2[i]);
}
if(sum==0)
{cout << "Yes" << endl;}
else
{
    cout << "No" << endl;
}
return;
}

int32_t main()
{
    ios::sync_with_stdio(0);

	cin.tie(0);
	cout.tie(0);
 long long n;
 cin >> n;
 long long*arr = new long long[n];
 long long*arrw = new long long[n];
 
 for(int i = 0 ; i  < n; i++)
 {
    cin >> arr[i];
 }
 for(int i = 0 ; i  < n; i++)
 {
    cin >> arrw[i];
 }
 solve(arr,arrw ,n);
 return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <deque>
#include <bitset>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int, int>
#define PLL             pair<ll,ll>                 
#define rep(i,a,b)      for(int  i=a;i<=b;i++)
#define dec(i,a,b)      for(int  i=a;i>=b;i--)
#define forn(i, n)      for(int i = 0; i < int(n); i++)
using namespace std;
int dir[4][2] = { { 1,0 },{ 0,1 } ,{ 0,-1 },{ -1,0 } };
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-6;

inline ll read()
{
    ll x = 0; bool f = true; char c = getchar();
    while (c < '0' || c > '9') { if (c == '-') f = false; c = getchar(); }
    while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
    return f ? x : -x;
}

ll gcd(ll m, ll n)
{
    return n == 0 ? m : gcd(n, m % n);
}

ll qpow(ll m, ll k, ll mod)
{
    ll res = 1, t = m;
    while (k)
    {
        if (k & 1)
            res = res * t % mod;
        t = t * t % mod;
        k >>= 1;
    }
    return res;
}
/**********************************************************/
const ll mod = 998244353;
const int N = 1e5 + 5;
ll a[N], b[N];
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    cin >> n;

    rep(i, 1, n)
        cin >> a[i];
    rep(i, 1, n)
        cin >> b[i];
    ll ans = 0;
    rep(i, 1, n)
        ans += a[i] * b[i];
    if (ans)
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
}



