#include <bits/stdc++.h>
using namespace std;
int N, M, gN, gM;
char sir[101010], sir2[101010];
int v[101010], v1[101010];
int main() {
  scanf("%s", sir + 1);
  scanf("%s", sir2 + 1);
  N = strlen(sir + 1);
  M = strlen(sir2 + 1);
  gM = M;
  gN = N;
  for (int i = 1; i <= N; ++i) {
    if (sir[i] == '1')
      v[i] = 1;
    else
      v[i] = 0;
  }
  for (int i = 1; i <= M; ++i) {
    if (sir2[i] == '1')
      v1[i] = 1;
    else
      v1[i] = 0;
  }
  int s1 = 0;
  int s2 = 0;
  for (int i = 1; i <= N; ++i) s1 += v[i];
  for (int i = 1; i <= M; ++i) s2 += v1[i];
  if (s2 <= 2 * ((s1 + 1) / 2)) {
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
