#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  int x, y;
  while (cin >> s1 >> s2) {
    x = 0, y = 0;
    for (int i = 0; i < s1.size(); i++) {
      if (s1[i] == '1') x++;
    }
    for (int j = 0; j < s2.size(); j++) {
      if (s2[j] == '1') y++;
    }
    if (y == x)
      printf("YES\n");
    else if (x > y)
      printf("YES\n");
    else if (x < y && abs(x - y) == 1 && x % 2 != 0) {
      if (abs(y - x) == 1) printf("YES\n");
    } else
      printf("NO\n");
  }
}
