#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  getline(cin, s);
  getline(cin, t);
  bool vys = false;
  int poc = 0;
  for (int i = 0; i < (s.length()); i++)
    if (s[i] == '1') poc++;
  for (int i = 0; i < (s.length() + 1); i++) {
    if (s.length() - i > t.length()) continue;
    bool pom = true;
    for (int j = i; j < s.length(); j++)
      if (s[j] != t[j - i]) pom = false;
    if (!pom) continue;
    int p = 0;
    for (int j = 0; j < (i); j++)
      if (s[j] == '1') p++;
    int p1 = 0;
    for (int j = s.length() - i; j < t.length(); j++)
      if (t[j] == '1') p1++;
    if ((poc % 2) + p >= p1) vys = true;
  }
  if (vys)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
