#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, bool> w;
  string a;
  int n, m, d = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a;
    w[a] = true;
  }
  for (int i = 0; i < m; i++) {
    cin >> a;
    if (w[a]) d++;
  }
  if (d % 2 == 1) n++;
  if (n > m)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
