#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i;
  vector<string> v;
  cin >> n >> m;
  for (i = 0; i < n + m; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  int c = 0;
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) {
    if (v[i] == v[i + 1]) {
      c++;
      i++;
    }
  }
  int a, b;
  a = n - c;
  b = m - c;
  if (c % 2 == 0) {
    a = a + c / 2;
    b = b + c / 2;
  } else {
    a = a + (c / 2) + 1;
    b = b + c / 2;
  }
  if (a > b) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
