#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
map<string, int> mep;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, i, j, k, a = 0, b = 0, c = 0, id;
  string x;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> x;
    mep[x] = true;
  }
  for (i = 0; i < m; i++) {
    cin >> x;
    if (mep[x] == true) c++;
  }
  a = n - c;
  b = m - c;
  int p = (c + 1) / 2, q = c / 2;
  if (a + p > b + q)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
