#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 1e5 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
using namespace std;
bool used[100001];
map<string, bool> mp;
pair<int, int> p[10001];
void solve() {
  int n, m, ct = 0;
  string s;
  cin >> n >> m;
  if (n > m) {
    cout << "YES\n" << endl;
    return;
  }
  if (n < m) {
    cout << "NO\n" << endl;
    return;
  }
  for (int i = 0; i < n; ++i) {
    cin >> s;
    mp[s] = true;
  }
  for (int i = 0; i < m; ++i) {
    cin >> s;
    if (mp[s]) ct++;
  }
  if (ct % 2) {
    cout << "YES\n";
    return;
  } else {
    cout << "NO\n";
    return;
  }
}
bool mtest = false;
int main() {
  ios_base::sync_with_stdio(0);
  int TE = 1;
  if (mtest) cin >> TE;
  while (TE--) solve();
  return 0;
}
