#include <bits/stdc++.h>
using namespace std;
int x, y;
int main() {
  string a, b;
  cin >> a >> b;
  for (char c : a) x += (c == '1');
  for (char c : b) y += (c == '1');
  if (x >= y || (x & 1 && x >= y - 1))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
