#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
char str1[MAXN], str2[MAXN];
int cnt1, cnt2, len1, len2;
int main() {
  scanf("%s", str1 + 1);
  len1 = strlen(str1 + 1);
  scanf("%s", str2 + 1);
  len2 = strlen(str2 + 1);
  for (int i = 1; i <= len1; ++i) cnt1 += str1[i] - '0';
  for (int i = 1; i <= len2; ++i) cnt2 += str2[i] - '0';
  if (cnt1 >= cnt2 || ((cnt1 & 1) && (cnt2 == cnt1 + 1)))
    puts("YES");
  else
    puts("NO");
  return 0;
}
