#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n,i;
	cin>>n;
	std::vector<ll> v1;
	std::vector<ll> v2;
	ll x;
	for(i=0;i<n;i++)
	{
		cin>>x;
		v1.push_back(x);
	}
	for(i=0;i<n;i++)
	{
		cin>>x;
		v2.push_back(x);
	}
	ll sum=0;
	for(i=0;i<n;i++)
	{
		sum=sum+v1[i]*v2[i];
	}
	if(sum==0)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
	cout<<"\n";
}

// 0 1 2 3 4 5 6 7 8 9
// 11 12 13 
/*case 1:
61523
3210
dth 3rd
2000-2999,12000-12999,22000-22999,32000-32999,42000-42999, 52000-52999

200-299,1200-1299

61523 round down 60000 roundup 70000
 123 roudn down 100

case 2: if(value>2)
63326

2000-2999,12000-12999, 52000-52999,62000-62999

0-70000


case 3: if(value==2)
62326
2000-2999,12000-12999,22000-22999,32000-32999,42000-42999, 52000-52999, 62000-62326
10^d+1*/
///////////////////////////////
///     Let's Get AC!!!     ///
///////////////////////////////

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in) for(int i=0; i<(int)in.size(); i++) cin>>in[i]
#define forout(out) for(int i=0; i<(int)out.size(); i++) cout<<out[i]<<endl
#define rep(i, n) for(int i=0; i<(int)(n); i++)

int main(){
  int n,a[10000];
  cin >> n;
  int ans=0;
  for(int i=0;i<n;i++){
  cin >> a[i];
    if(a[i]>10){
    ans+=a[i]-10;
    }
  }
  cout << ans << endl;
}