#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, t = 1, countt = 0, wa = 0, wb = 0;
  vector<string> a, b;
  map<string, int> c;
  string str;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> str;
    a.push_back(str);
    c[str] = 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> str;
    b.push_back(str);
    if (c[str] == 1) countt++;
  }
  if (countt % 2 == 1) {
    wa++;
    t = 2;
  } else if (countt != 0 && countt % 2 == 0) {
    wb++;
    t = 1;
  }
  if ((a.size() - countt) > (b.size() - countt)) {
    if (t == 2) t = 1;
    wa++;
  } else if ((a.size() - countt) < (b.size() - countt)) {
    if (t == 1) t = 2;
    wb++;
  } else {
    int temp = (a.size() - countt);
    if (t == 1)
      t = 2;
    else if (t == 2)
      t = 1;
  }
  if (t == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
