#include <bits/stdc++.h>
using namespace std;
int main() {
  string n, m;
  int i, cnt = 0, cnt2 = 0;
  cin >> n >> m;
  for (i = 0; i < n.length(); i++) {
    if (n[i] == '1') {
      cnt++;
    }
  }
  for (i = 0; i < m.length(); i++) {
    if (m[i] == '1') {
      cnt2++;
    }
  }
  if (cnt % 2 == 1) {
    if (cnt2 <= cnt + 1) {
      cout << "YES";
      return 0;
    }
  } else {
    if (cnt2 <= cnt) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
