#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>
 
using namespace std;

typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)

#define MOD 1000000007

int main(){
  ll n;
  cin>>n;
  ll b = 0;
  vector<ll> v1,v2;
  rep(i,0,n){
    ll a;
    cin>>a;
    v1.pb(a);
  }
  rep(i,0,n){
    ll a;
    cin>>a;
    v2.pb(a);
  }
  rep(i,0,n){
    b += v1[i]*v2[i];
  }
  if(b==0){
      cout << "Yes" << endl;
  }
  else{
      cout << "No" << endl;
  }
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,k,m;
  cin >> n >> k >> m;
  int sum=0;
  vector<int>a(n-1);
  for(int i=0;i<n-1;i++) {
    cin >> a.at(i);
    sum+=a.at(i);
    }
  int x=m*n-sum;
  if(x>k) {
    cout << -1 << endl;}
  else if (x<=k && x>=0) {
    cout << x << endl;}
  else {
    cout << 0 << endl;}
  
    
  return 0;
  }
    
    
