#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k = 0, m = 0, n, t, f = 0, x, z, y, p = 0, ans = 0,
                  mn = 10000000009, mx = 0;
  cin >> n >> m;
  vector<string> v, v1;
  map<string, long long> mp, np;
  string s;
  long long common = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
    mp[s]++;
  }
  for (i = 0; i < m; i++) {
    cin >> s;
    v1.push_back(s);
    np[s]++;
    if (np[s] <= mp[s]) common++;
  }
  x = n - common;
  y = m - common;
  if (x > y)
    cout << "YES";
  else if (x == y && (common & 1))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
