#include <bits/stdc++.h>
using namespace std;
int main() {
  unordered_map<char, int> m1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k, t, n, a, b, c, m, sum, f, temp;
  string s;
  {
    sum = 0, f = 0, c = 0;
    cin >> n >> m;
    set<string> s;
    string arr[n], brr[m];
    for (i = 0; i < n; i++) cin >> arr[i], s.insert(arr[i]);
    for (j = 0; j < m; j++) cin >> brr[j], s.insert(brr[j]);
    a = s.size();
    b = n + m - a;
    if ((n + b % 2) > m)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
