#include <bits/stdc++.h>
using namespace std;
unordered_map<string, pair<int, bool> > u;
bool cmp(string x, string y) { return u[x].first > u[y].first; }
int n, m;
string a[1000 + 5], b[1000 + 5];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i], u[a[i]].first = 1;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    if (u[b[i]].first) u[b[i]].first++;
  }
  sort(a + 1, a + n + 1, cmp);
  sort(b + 1, b + m + 1, cmp);
  int i, j, turn;
  char l;
  for (i = 1, j = 1, turn = 0; (i <= n && j <= m); turn++) {
    if (turn % 2 == 0) {
      while (i <= n) {
        if (!u[a[i]].second) {
          u[a[i]].second = true;
          break;
        }
        i++;
      }
      l = 'i';
    } else {
      while (j <= m) {
        if (!u[b[j]].second) {
          u[b[j]].second = true;
          break;
        }
        j++;
      }
      l = 'j';
    }
  }
  if (l == 'i')
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
