#include <bits/stdc++.h>
using namespace std;
int cn1, cn2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s, o;
  cin >> s >> o;
  for (int i = 0; i < (s.size()); i++) cn1 += s[i] - '0';
  for (int i = 0; i < (o.size()); i++) cn2 += o[i] - '0';
  if (cn1 >= cn2)
    cout << "YES";
  else if (cn1 % 2 && cn1 + 1 == cn2)
    cout << "YES";
  else
    cout << "NO";
}
