#pragma GCC optimize("Ofast")
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <cctype>
#include <sstream>
#include <stack>
#include <deque>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>  

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Po = pair<double, double>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=ll(a);i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define PB push_back
#define MP make_pair
#define SZ(x) ll(x.size())
#define ALL(x) x.begin(),x.end()
#define NIL -1
#define INF pow(2,31)-1
#define MOD 1000000007
#define PI 3.14159265358979323846
#define endl "\n"
#define EPS 1e-9

template <class T, class U>
bool chmin(T& t, const U& u) {
	if (t > u) {
		t = u;
		return true;
	}
	else return false;
}
template <class T, class U>
bool chmax(T& t, const U& u) {
	if (t < u) {
		t = u;
		return true;
	}
	else return false;
}

ll powmod(ll x, ll n, ll mod) {
	ll s = 1;
	REP(i, n) {
		s = s * x % mod;
	}
	if (s < 0)s += mod;
	return s;
}

signed main() {
	ll n;
	cin >> n;
	V<ll> a(n), b(n);
	REP(i, n)cin >> a[i];
	REP(i, n)cin >> b[i];
	ll c = 0;
	REP(i, n) {
		c += a[i] * b[i];
	}
	c ? cout << "No" << endl : cout << "Yes" << endl;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n;
    cin >>n;
    vector <long long> a(n), b(n);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >>b[i];
    }
    long long res = 0;
    for (int i = 0; i < n; ++i) {
        long long cur = a[i] * b[i];
        res += cur;
    }
    if (res == 0) {
        cout <<"Yes"<<endl;
    }
    else {
        cout <<"No"<<endl;
    }
}
