#include <bits/stdc++.h>
using namespace std;
int eve(long long int x) {
  if (x % 2 == 0) return 1;
  return 0;
}
void solve() {
  int x, i, n, m;
  cin >> n >> m;
  string t;
  map<string, int> mp;
  for (i = 0; i < n; ++i) {
    cin >> t;
    mp[t] = 1;
  }
  x = 0;
  for (i = 0; i < m; ++i) {
    cin >> t;
    if (mp[t]) x++;
  }
  if (n - x > m - x)
    x = 1;
  else if (n - x < m - x)
    x = 0;
  else if (x % 2 == 1)
    x = 1;
  else
    x = 0;
  if (x == 0)
    cout << "NO";
  else
    cout << "YES";
  cout << endl;
  ;
}
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
}
