#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define LLI long long int
#define REP(i, n) for(LLI i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(LLI i = s, i##_l = (e); i < i##_l; i++)
#define _min(a,b) ((a<b)?a:b)
#define _max(a,b) ((a<b)?b:a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a)?1:-1)
#define SORT(v) sort(v.begin(),v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380


int main()
{
	cout << fixed << setprecision(10);

	int n;
	cin >> n;
	int ans = 0;
	vector<int> a(n);
	vector<int> b(n);
	REP(i, n)
	{
		cin >> a[i];
	}
	REP(i, n)
	{
		cin >> b[i];
	}
	REP(i, n)
	{
		ans += a[i] * b[i];
	}
	if (ans == 0)
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
	return 0;
}
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int keisan(int num) {
    int goukei = 0;
    for (int i=0; i<3; i++) {
        goukei += num%10;
        num /= 10;
    }
    return goukei;
}

int main() {
    int a, b;
    
    cin >> a >> b;
    
    a = keisan(a);
    b = keisan(b);
    
    if (a > b) {
        cout << a;
    }else {
        cout << b;
    }
}
