#include <bits/stdc++.h>

using namespace std;


typedef long long ll;

#define vt vector
#define all(x) x.begin(), x.end()
#define trav(i, x) for(auto &i : x)
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back

void solve() {
    int n; scanf("%d", &n);
    vector<int> a(n), b(n);
    trav(i, a) scanf("%d", &i);
    trav(i, b) scanf("%d", &i);
    ll res=0;
    for(int i = 0; i < n; i++) {
        res += a[i]*b[i];
    }

    printf((res==0?"Yes":"No"));
}
int main() {

	int t = 1, i = 1;
	while(t--) {
		// printf("Case #%d: ", i)
		solve();
		i++;
	}
}

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << a*d-b*c;
  return 0;
}