#include <bits/stdc++.h>
using namespace std;
const double Pi = acos(-1.0);
int N, M;
string a[1001], b[1001];
map<string, int> cnt;
int main() {
  if (fopen("data.in", "r")) freopen("data.in", "r", stdin);
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  for (int i = 0; i < M; i++) {
    cin >> b[i];
    cnt[b[i]]++;
  }
  int repeat = 0;
  for (map<string, int>::iterator it = cnt.begin(); it != cnt.end(); it++)
    if (it->second == 2) repeat += 1;
  int poly = (repeat + 1) / 2 + N - repeat;
  int enem = repeat / 2 + M - repeat;
  if (enem >= poly)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
