#include <bits/stdc++.h>
using namespace std;
int n, i, m, pr, a, b, p;
map<string, int> mp;
string s[10000], s1[10000];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    mp[s[i]] = 1;
  }
  for (int i = 1; i <= m; i++) {
    cin >> s1[i];
    if (mp[s1[i]] == 1) p++;
    mp[s1[i]] = 1;
  }
  b = p / 2;
  a = p - b;
  a += (n - p);
  b += (m - p);
  if (b >= a)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
