#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[10001], b[10001];
  scanf("%s", a);
  scanf("%s", b);
  int la = strlen(a), lb = strlen(b), count_a = 0, count_b = 0;
  for (int i = 0; i < la; i++)
    if (a[i] == '1') count_a++;
  for (int i = 0; i < lb; i++)
    if (b[i] == '1') count_b++;
  int x;
  if (count_a & 1)
    x = count_a + 1;
  else
    x = count_a;
  if (x < count_b) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
