#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int a0 = 0, a1 = 0, b0 = 0, b1 = 0;
  for (int i = 0; i < ((int)a.size()); i++) {
    if (a[i] == '0')
      a0++;
    else
      a1++;
  }
  for (int i = 0; i < ((int)b.size()); i++) {
    if (b[i] == '0')
      b0++;
    else
      b1++;
  }
  if (a1 % 2 == 1) a1++;
  if (b1 > a1)
    cout << "NO" << endl;
  else if (b1 == a1)
    cout << "YES" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
