#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int len1 = s1.length(), len2 = s2.length(), x = 0, y = 0;
  for (int i = 0; i < len1; i++)
    if (s1[i] == '1') x++;
  for (int i = 0; i < len2; i++)
    if (s2[i] == '1') y++;
  cout << ((x >= y || (x + 1 == y && x % 2)) ? "YES" : "NO") << "\n";
  return 0;
}
