#include <bits/stdc++.h>
using namespace std;
char a[1001], b[1001];
int main() {
  int sa, sb, i, j, ta = 0, tb = 0;
  cin >> a >> b;
  sa = strlen(a);
  sb = strlen(b);
  for ((i) = 0; (i) < (sa); (i)++)
    if (a[i] == '1') ta++;
  for ((i) = 0; (i) < (sb); (i)++)
    if (b[i] == '1') tb++;
  if (ta >= tb)
    cout << "YES" << endl;
  else if (ta % 2 && tb == ta + 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
