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


int main(){
    int n,temp;
    cin >> n;
    vector<int> myvec(n);
    for(int i = 0;i < n;i++){
        cin >> myvec[i];
    }
    int result = 0;
    for(int i = 0;i < n;i++){
        cin >> temp;
        result += temp*myvec[i];
    }
    if(result == 0){
        cout << "Yes";
    }
    else{
        cout << "No";
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int               long long
#define pb                push_back
#define mp                make_pair
#define pii               pair<int,int>
#define vec               vector<int>
#define mii               map<int,int>
#define pqb               priority_queue<int>
#define no_of_test(zzz)   int zzz; cin>>zzz; while(zzz--)
#define p(c)              cout<<c<<'\n';
const int mod = 1e9 + 7;
void speed()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
//Actual Code Is At The Top
int32_t main()
{
	speed();
	//no_of_test(zzz)
	{
		string s;
		int n;
		cin >> n;
		set<string>set;
		for (int i = 0; i < n; i++)
		{
			cin >> s;
			set.insert(s);
		}
		for (auto x : set)
		{
			if (set.count('!' + x))
			{
				cout << x << '\n';
				return 0;
			}
		}
		cout << "satisfiable" << '\n';
	}
	return 0;
}
//cout<<"###"<<'\n';
//cout<<"."<<'\n';
//cout<<"****"<<'\n';
/*
&& abs(a) + abs(b) < abs(c) + abs(d)
*/
