#include <bits/stdc++.h>
using namespace std;
void Emsawy() {}
int dx[]{1, -1, 0, 0, 1, -1, 1, -1};
int dy[]{0, 0, 1, -1, 1, -1, -1, 1};
long long suf(long long x) { return (x * (x + 1)) / 2; }
vector<vector<pair<int, int> > > adj;
const long long mod = 1e9 + 7, oo = 1e9;
int n, m;
int main() {
  Emsawy();
  while (cin >> n >> m) {
    vector<string> vn(n), vm(m);
    for (int i = 0; i < n; i++) {
      cin >> vn[i];
    }
    for (int i = 0; i < m; i++) {
      cin >> vm[i];
    }
    int rem = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (vn[i] == vm[j]) {
          rem++;
          break;
        }
      }
    }
    int a = n - rem + ceil(rem / 2.0), b = m - rem + (rem / 2);
    if (a > b)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
