#include <bits/stdc++.h>
using namespace std;
string a, b;
int cta = 0, ctb = 0;
int main() {
  cin >> a >> b;
  for (int i = 0; i < a.length(); ++i) cta += (a[i] == '1');
  for (int i = 0; i < b.length(); ++i) ctb += (b[i] == '1');
  if (cta % 2 == 0) {
    cout << ((ctb <= cta) ? "YES" : "NO") << endl;
  } else {
    cout << ((ctb <= cta + 1) ? "YES" : "NO") << endl;
  }
}
