#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, me;
  cin >> n >> me;
  map<string, long long> m;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s] += 1;
  }
  for (long long i = 0; i < me; i++) {
    string s;
    cin >> s;
    m[s] -= 1;
  }
  long long count1 = 0, count0 = 0, count2 = 0;
  for (auto it = m.begin(); it != m.end(); it++)
    if ((*it).second == 1)
      count1++;
    else if ((*it).second == -1)
      count2++;
    else
      count0++;
  if (count0 % 2 == 0) {
    if (count1 > count2)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  } else {
    if (count1 + 1 > count2)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  return 0;
}
