#include <bits/stdc++.h>
using namespace std;
int N, M, c;
string a[1010], b[1010];
map<string, bool> mp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  int i;
  for (i = 1; i <= N; i++) cin >> a[i], mp[a[i]] = 1;
  for (i = 1; i <= M; i++) {
    cin >> b[i];
    if (mp[b[i]]) c++;
  }
  N = N - c + (c + 1) / 2;
  M = M - c + c / 2;
  if (N > M)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
