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

#define BOOST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rept(it,v) for(auto it=v.begin();it!=v.end();it++)
#define pre(i,a,b) for(int i=a;i>=b;i--)
#define mp make_pair
#define pb push_back
#define endl "\n"
#define mod 1000000007
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll> 
#define vl vector<ll>
#define vi vector<int>
#define all(x) x.begin(),x.end()
#define sp(x) setprecision(x)
#define lb lower_bound
#define ub upper_bound
#define ll long long
#define pb push_back
#define pob pop_back
#define mt make_tuple
#define F first
#define S second
#define endl "\n"
#define ct continue
#define fill(a,b) memset(a,b,sizeof(a))
#define bs binary_search
#define gcd __gcd
#define sz(x) (int)((x).size())
#define test cin>>t; while(t--)
ll n,q,i,j,cnt,cnt2,a[1000000],d,b[1000000],x1,x2,sum,c[1000000],t,x,p,y,m,z,l,k,inv,ans,mi,ma,flag,check;
vector <ll> v1,v2;
string s;

map <ll,ll> mp1,mp2;
int main()
{
  BOOST
  //test
  {
    cin>>x>>y>>z;
    if(x>y)
      cout<<"Takahashi"<<'\n';
    else if(x<y)
      cout<<"Aoki"<<'\n';
    else
    {
      if(z == 0)
        cout<<"Aoki"<<'\n';
      else
        cout<<"Takahashi"<<'\n';
    }
    
  }
}
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

struct UnionFind {
  vector<int> p;
  UnionFind(int n) : p(n, -1) {}

  bool unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y)
      return false;

    if (-p[x] < -p[y])
      swap(x, y);
    p[x] += p[y];
    p[y] = x;
    return true;
  }

  int root(int x) {
    if (p[x] < 0)
      return x;
    return root(p[x]);
  }

  int size(int x) { return -p[root(x)]; }
};

int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];

  UnionFind uf(n);
  rep(i, m) {
    int c, d;
    cin >> c >> d;
    uf.unite(--c, --d);
  }

  vector<ll> s(n);
  rep(i, n) s[uf.root(i)] += b[i] - a[i];
  bool ans = true;
  rep(i, n) if (s[i] != 0) ans = false;
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
