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