#include <bits/stdc++.h>
using namespace std;
int ni() {
  int val;
  scanf("%i", &val);
  return val;
}
pair<int, int> npi() {
  int valf, vals;
  scanf("%i %i", &valf, &vals);
  return make_pair(valf, vals);
}
int64_t nll() {
  int64_t val;
  scanf("%I64d", &val);
  return val;
}
char nc() {
  char val;
  do {
    scanf("%c", &val);
  } while (val == ' ' || val == '\r' || val == '\n');
  return val;
}
string ns() {
  static char buff[1024 * 2000];
  scanf("%s", buff);
  return string{buff};
}
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    auto tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
int ret(int ans) {
  printf("%i\n", ans);
  exit(0);
}
int main() {
  int n = ni(), m = ni();
  set<string> st[2];
  for (int i = 0; i < n; ++i) {
    auto s = ns();
    st[0].emplace(s);
  }
  for (int i = 0; i < m; ++i) {
    auto s = ns();
    st[1].emplace(s);
  }
  int tr = 0;
  while (true) {
    bool found = false;
    string word;
    for (auto& wrd : st[tr]) {
      if (st[1 - tr].count(wrd)) {
        word = wrd;
        found = true;
        break;
      }
    }
    if (found) {
      st[tr].erase(word);
      st[1 - tr].erase(word);
    } else {
      for (auto& wrd : st[tr]) {
        word = wrd;
        found = true;
        break;
      }
      if (found) {
        st[tr].erase(word);
        st[1 - tr].erase(word);
      } else {
        tr = 1 - tr;
        break;
      }
    }
    tr = 1 - tr;
  }
  if (tr == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
