#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  map<string, int> pol;
  map<string, int> en;
  cin >> n >> m;
  int whole = 0;
  string j;
  for (int i = (0); i < (n); i++) {
    cin >> j;
    pol[j] = 1;
  }
  for (int i = (0); i < (m); i++) {
    cin >> j;
    en[j] = 1;
    if (pol[j] == 1) whole++;
  }
  int p = 0, em = 0;
  if (whole % 2 == 0) {
    p += whole / 2;
    em += whole / 2;
  } else {
    whole--;
    p += whole / 2;
    p += 1;
    em += whole / 2;
  }
  for (map<string, int>::iterator it = pol.begin(); it != pol.end(); it++) {
    if (en[it->first] == 0) p++;
  }
  for (map<string, int>::iterator it = en.begin(); it != en.end(); it++) {
    if (pol[it->first] == 0) em++;
  }
  if (p > em)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
