#include <bits/stdc++.h>
using namespace std;
int x, y, a, b;
char A[1005], B[1005];
int main() {
  scanf("%s%s", A, B);
  a = strlen(A);
  b = strlen(B);
  for (int i = 0; i < a; ++i)
    if (A[i] == '1') ++x;
  for (int i = 0; i < b; ++i)
    if (B[i] == '1') ++y;
  if (x & 1) {
    if (y <= x + 1)
      puts("YES");
    else
      puts("NO");
  } else if (y <= x)
    puts("YES");
  else
    puts("NO");
  return 0;
}
