#include <bits/stdc++.h>
using namespace std;
void rrr() {}
int main() {
  rrr();
  string a, b;
  cin >> a >> b;
  int k1 = 0, k2 = 0;
  for (int i = (0); i < (a.size()); ++i)
    if (a[i] == '1') ++k1;
  for (int i = (0); i < (b.size()); ++i)
    if (b[i] == '1') ++k2;
  if ((k2 + 1) / 2 > (k1 + 1) / 2)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
};
