#include <bits/stdc++.h>
using namespace std;
void Oli() {
  int n, m;
  cin >> n >> m;
  vector<string> b(n);
  vector<string> c;
  for (int i = 0; i < n; i++) cin >> b[i];
  int com = 0;
  for (int i = 0; i < m; i++) {
    string x;
    cin >> x;
    bool f = false;
    for (int j = 0; j < b.size(); j++) {
      if (x == b[j]) {
        com++;
        b.erase(b.begin() + j);
        f = true;
        break;
      }
    }
    if (!f) c.push_back(x);
  }
  bool f = false;
  if (com % 2 == 0) {
    f = false;
  } else
    f = true;
  if (!f) {
    if (b.size() > c.size()) {
      f = true;
    }
  } else {
    if (b.size() < c.size()) {
      f = false;
    }
  }
  if (f)
    cout << "YES";
  else {
    cout << "NO";
  }
}
int main() {
  int times = 1;
  while (times--) Oli();
}
