#include <bits/stdc++.h>
using namespace std;
char a[1005], b[1005];
int main() {
  int n, na, nb;
  while (cin >> a >> b) {
    na = nb = 0;
    for (int i = 0; i < strlen(a); i++) {
      if (a[i] == '1') na++;
    }
    for (int i = 0; i < strlen(b); i++) {
      if (b[i] == '1') nb++;
    }
    int key = 1;
    if (na % 2 == 0) {
      if (nb > na) key = 0;
    } else {
      if (nb - na > 1) key = 0;
    }
    if (key)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
