#include <bits/stdc++.h>
const int inf_max = 0x3f3f3f3f;
const long long Linf = 9e18;
const int maxn = 3e7 + 10;
const double eps = 0.0001;
using namespace std;
int n, m, rp, cnt1, cnt2;
set<string> st;
int main() {
  while (~scanf("%d%d", &n, &m)) {
    string str;
    rp = cnt1 = cnt2 = 0;
    for (int i = 1; i <= n; i++) {
      cin >> str;
      st.insert(str);
    }
    for (int i = 1; i <= m; i++) {
      cin >> str;
      set<string>::iterator it = st.find(str);
      if (it != st.end()) rp++;
    }
    cnt1 = n - rp;
    cnt2 = m - rp;
    if (rp % 2) {
      if (cnt2 <= cnt1)
        printf("YES\n");
      else
        printf("NO\n");
    } else {
      if (cnt1 > cnt2)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
