#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int min(long long int a, long long int b) {
  return a + b - max(a, b);
}
set<int> primes;
int sieve[1000005];
void go() {
  for (int i = 2; i < 1000005; i++) {
    if (sieve[i] == 0) {
      primes.insert(i);
      for (int j = 2 * i; j < 1000005; j += i) sieve[j] = 1;
    }
  }
}
set<int> aSet, bSet;
vector<int> aVec, bVec;
map<string, int> Hash;
int main() {
  cin.sync_with_stdio(false);
  long long int i, j, n, l, r, m, k, sum = 0, Max = 0, x, y, d;
  string str;
  long long int ans = 0;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> str;
    if (Hash.find(str) == Hash.end()) Hash[str] = sum++;
    aSet.insert(Hash[str]);
    aVec.push_back(Hash[str]);
  }
  for (j = 0; j < m; j++) {
    cin >> str;
    if (Hash.find(str) == Hash.end()) Hash[str] = sum++;
    bSet.insert(Hash[str]);
    bVec.push_back(Hash[str]);
  }
  int winner = -1;
  for (i = 0; i < n + m; i++) {
    if (i % 2 == 0) {
      for (j = 0; j < aVec.size(); j++) {
        if (aSet.find(aVec[j]) != aSet.end() &&
            bSet.find(aVec[j]) != bSet.end()) {
          aSet.erase(aVec[j]);
          bSet.erase(aVec[j]);
          break;
        }
      }
      if (j == aVec.size()) {
        if (aSet.size() == 0) {
          winner = 1;
          break;
        }
        aSet.erase(aSet.begin());
      }
    } else {
      for (j = 0; j < bVec.size(); j++) {
        if (aSet.find(bVec[j]) != aSet.end() &&
            bSet.find(bVec[j]) != bSet.end()) {
          aSet.erase(bVec[j]);
          bSet.erase(bVec[j]);
          break;
        }
      }
      if (j == bVec.size()) {
        if (bSet.size() == 0) {
          winner = 0;
          break;
        }
        bSet.erase(bSet.begin());
      }
    }
  }
  if (winner == -1) {
    if (aSet.size() == 0 && bSet.size() == 0)
      winner = (m + n + 1) % 2;
    else if (aSet.size() == 0)
      winner = 1;
    else
      winner = 0;
  }
  if (winner == 0)
    cout << "YES";
  else if (winner == 1)
    cout << "NO";
  return 0;
}
