#include <bits/stdc++.h>
using namespace std;
map<string, long long int> ma, mb;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int i, m, n, x, j = 0, c = 0, r = 0, l, k, w = 0, s = 0, d = 0,
                            f = 0, sum = 0, mul, s1 = 0, s2 = 0, mx1 = -1,
                            mx2 = -1, mx3 = -1, mx = 1000000000000000000;
  cin >> n >> m;
  k = n;
  while (n--) {
    string a;
    cin >> a;
    ma[a]++;
  }
  l = m;
  while (m--) {
    string a;
    cin >> a;
    if (ma[a] != 0) {
      c++;
    }
  }
  if (k - c + (c % 2) > (l - c)) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
