#include <bits/stdc++.h>
using namespace std;
const long long inf = 9e18;
const long long M = 1e9 + 7;
const long long N = 1e2 + 5;
set<string> st;
map<string, bool> b1, b2;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, nos(0), n1(0), n2(0), res1(0), res2(0);
  cin >> n >> m;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    st.insert(s);
    b1[s] = 1;
  }
  for (long long i = 0; i < m; ++i) {
    string s;
    cin >> s;
    st.insert(s);
    b2[s] = 1;
  }
  for (set<string>::iterator it = st.begin(); it != st.end(); it++) {
    if (b1[*it] && b2[*it]) {
      ++nos;
    }
  }
  n1 = (nos + 1) / 2, n2 = nos - n1;
  for (map<string, bool>::iterator it = b1.begin(); it != b1.end(); ++it) {
    if (it->second) ++res1;
  }
  for (map<string, bool>::iterator it = b2.begin(); it != b2.end(); ++it) {
    if (it->second) ++res2;
  }
  if (n1 + res1 > n2 + res2) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
