#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, i, j, n;
int main() {
  map<string, long long> m, m1;
  cin >> a >> b;
  string s;
  for (i = 1; i <= a; i++) {
    cin >> s;
    m[s]++;
  }
  d = b;
  for (i = 1; i <= b; i++) {
    cin >> s;
    if (m[s] > 0) {
      n++;
      a--;
      d--;
      m[s]--;
    }
  }
  if (n % 2 == 1) {
    if (d > a)
      cout << "NO";
    else
      cout << "YES";
  } else {
    if (a > d)
      cout << "YES";
    else
      cout << "NO";
  }
}
