#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int n, m;
char a[N], b[N];
int main() {
  scanf("%s%s", a, b);
  n = strlen(a);
  m = strlen(b);
  int with = 0, all = 0;
  for (int i = 0; i < n; ++i)
    if (a[i] == '1') ++with;
  if (with & 1) ++with;
  bool can = true;
  for (int i = 0; i < m; ++i) {
    int o = with + all;
    if (b[i] == '0') {
      if (o & 1) --with;
    } else {
      if ((o & 1) == 0) --with;
      ++all;
    }
    if (with < 0) {
      can = false;
      break;
    }
  }
  if (can)
    puts("YES");
  else
    puts("NO");
  return 0;
}
