#include <bits/stdc++.h>
using namespace std;
int main() {
  int PB, EB;
  cin >> PB >> EB;
  string PBW[1001], EBW[1001];
  map<string, bool> interc;
  int u_P = 0, u_E = 0, c_W = 0;
  for (int i = 1; i <= PB; i++) {
    cin >> PBW[i];
    interc[PBW[i]] = true;
    u_P++;
  }
  for (int i = 1; i <= EB; i++) {
    cin >> EBW[i];
    if (interc[EBW[i]] == true) {
      u_P--;
      u_E--;
      c_W++;
    }
    u_E++;
  }
  int t = 0;
  if (c_W % 2 == 1) t = 1;
  if (t == 1) u_E--;
  if (u_P > u_E) cout << "YES";
  if (u_P < u_E) cout << "NO";
  if (u_P == u_E) cout << "NO";
  return 0;
}
