#include <bits/stdc++.h>
using namespace std;
int count(string &s) {
  int p = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '1') p++;
  }
  return p;
}
int main() {
  string a, b;
  cin >> a >> b;
  int x, y;
  x = count(a);
  y = count(b);
  if (x >= y || (x + 1 == y && x % 2 == 1))
    cout << "YES";
  else
    cout << "NO";
}
