#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5, OO = 0x3f3f3f3f;
int n, m, cnt = 0;
string s;
map<string, int> mp;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    if (mp[s]) cnt++;
  }
  n -= cnt, m -= cnt;
  if (cnt % 2 == 1) n++;
  if (m >= n)
    puts("NO");
  else
    puts("YES");
  return 0;
}
