#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define frfr  freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout)
#define ll long long int
#define wh int T;cin >> T;while(T--)
#define foro(i,n) for(int i=0;i<n;i++)

void solve(){
    int n;
    cin >> n;
    ll t = 0;
    int a[n];
    int b[n];
    foro(i,n){
		cin >> a[i];
	
	}
    foro(i,n){
		cin >> b[i];
	
	}
    foro(i,n){
		t += a[i]*b[i];
	
	}
	
	if(t == 0){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
		
}
int main()
{
    //IOS;
    
    //wh{
        solve();
    //}
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
template<typename T> using vec = vector<T>;
template<typename K, typename V> using umap = unordered_map<K, V>;
using ll = long long;
using ld = long double;
using str = string;
using pll = pair<ll, ll>;
using vll = vec<ll>;
using vi = vec<int>;
using vs = vec<str>;
using mapll = map<ll, ll>;
using umapll = umap<ll, ll>;
#define _rep(i, n) _repi(i, 0, n)
#define _repi(i, l, r) for (ll i = ll(l); i < ll(r); i++)
#define _get_rep(_1, _2, _3, NAME, ...) NAME
#define rep(...) _get_rep(__VA_ARGS__, _repi, _rep) (__VA_ARGS__)
#define rrep(i, n) for (ll i = ll(n) - 1; 0 <= i; i--)
#define each(v) for (auto v)
#define all(x) x.begin(), x.end()
#define mkpair make_pair
#define is_in(x, l, r) ((l) <= (x) && (x) < (r))
#define read(t, ...) t __VA_ARGS__; isin(cin, __VA_ARGS__)
#define readv(t, v, n) vec<t> v(n); isin(cin, v)
#define readv2(t, v, h, w) vec<vec<t>> v(h, vec<t>(w)); isin(cin, v)
#define readvv(t, va, vb, n) vec<t> va(n), vb(n); rep (i, n) { isin(cin, va[i], vb[i]); }
#define readvvv(t, va, vb, vc, n) vec<t> va(n), vb(n), vc(n); rep (i, n) { isin(cin, va[i], vb[i], vc[i]); }
#define print(...) osout(cout, __VA_ARGS__)
#define dbg(...) osout(cerr, __VA_ARGS__)
const ll inf = numeric_limits<ll>::max() / 2;
template<typename T> bool chmax(T &x, const T &y) { if (x < y) { x = y; return 1; } return 0; }
template<typename T> bool chmin(T &x, const T &y) { if (x > y) { x = y; return 1; } return 0; }
template<typename T> void sort(vec<T> &v) { sort(all(v)); }
template<typename T> void rsort(vec<T> &v) { sort(all(v), greater<T>()); }
template<typename T> void dec(vec<T> &v) { rep (i, v.size()) v[i]--; }
template<typename T> istream& operator >>(istream &is, vec<T> &v) {
    rep (i, v.size()) { cin >> v[i]; } return is;
}
template<typename T1, typename T2> ostream& operator <<(ostream &os, pair<T1, T2> p) {
    if (&os == &cout) { os << p.first << ' ' << p.second; }
    if (&os == &cerr) { os << '(' << p.first << ", " << p.second << ')'; }
    return os;
}
template<typename T> ostream& operator <<(ostream &os, vec<T> v) {
    if (&os == &cout) { rep(i, v.size() - 1) { os << v[i] << ' '; } os << v[v.size() - 1]; }
    if (&os == &cerr) { os << '['; rep(i, v.size() - 1) { os << v[i] << ", "; } os << v[v.size() - 1] << ']'; }
    return os;
}
void isin(istream &_) {}
template<class S, class... T> void isin(istream &is, S &s, T&... t) {
    is >> s; isin(is, t...);
}
void osout(ostream& os) { os << endl; }
template<class S, class... T> void osout(ostream &os, S s, T... t) {
    os << s; if (sizeof...(t)) os << ' '; osout(os, t...);
}
void solve();

int main() {
    #define PRECISION 0

    cin.tie(0);
    ios::sync_with_stdio(false);
    if (PRECISION) {
        cout << fixed << setprecision(15);
        cerr << fixed << setprecision(15);
    }
    solve();
    return 0;
}

void solve() {
  read(ll,n);
  readv(ll,a,n);
  readv(ll,b,n);
  ll t=0;
  rep(i,n)t+=a[i]*b[i];
  print(t==0?"Yes":"No");
}
