#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0 && n != i) return false;
  }
  return true;
}
int32_t main() {
  int n, m;
  cin >> n >> m;
  set<string> st1, st2, st3;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    st1.insert(s);
  }
  for (int i = 0; i < m; ++i) {
    string s;
    cin >> s;
    st2.insert(s);
  }
  for (set<string>::iterator iter = st1.begin(); iter != st1.end(); ++iter) {
    if (st2.find(*iter) != st2.end()) {
      st3.insert(*iter);
    }
  }
  for (set<string>::iterator iter = st3.begin(); iter != st3.end(); ++iter) {
    st1.erase(*iter);
    st2.erase(*iter);
  }
  int c1 = st1.size();
  int c2 = st2.size();
  int c3 = st3.size();
  int p = 1;
  while (true) {
    if (c3) {
      --c3;
      p = (p == 1 ? 2 : 1);
    } else {
      if (p == 1) {
        if (!c1) {
          cout << "NO";
          return 0;
        }
        --c1;
        p = 2;
      } else {
        if (!c2) {
          cout << "YES";
          return 0;
        }
        --c2;
        p = 1;
      }
    }
  }
}
