You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations:

  * Write parity(a) to the end of a. For example, <image>. 
  * Remove the first character of a. For example, <image>. You cannot perform this operation if a is empty. 



You can use as many operations as you want. The problem is, is it possible to turn a into b?

The parity of a 01-string is 1 if there is an odd number of "1"s in the string, and 0 otherwise.

Input

The first line contains the string a and the second line contains the string b (1 ≤ |a|, |b| ≤ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.

Output

Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.

Examples

Input

01011
0110


Output

YES


Input

0011
1110


Output

NO

Note

In the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
import java.io.*;
import java.util.*;
import java.lang.*;
    public class templ {
        public static int a[]=new int[1000000];
    int binarySearch(int arr[], int l, int r, int x)
    {
        if (r >= l)
        {
            int mid = l + (r - l)/2;
            if (arr[mid] == x)
            return mid;
            if (arr[mid] > x) 
            return binarySearch(arr, l, mid-1, x);
            return binarySearch(arr, mid+1, r, x);
        }
        return -1;
    }
    int partition(int arr[],int a[], int low, int high)
    {
        int pivot = arr[high]; 
        int i = (low-1);
        for (int j=low; j<high; j++)
        {
            if (arr[j] <= pivot)
            {
                i++;
                int temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
                temp = a[i];
                a[i] = a[j];
                a[j] = temp;
            }
        }
        int temp = arr[i+1];
        arr[i+1] = arr[high];
        arr[high] = temp;
        temp = a[i+1];
        a[i+1] = a[high];
        a[high] = temp;
 
        return i+1;
    }
    void sort(int arr[],int a[], int low, int high)
    {
        if (low < high)
        {
            int pi = partition(arr,a, low, high);
            sort(arr,a, low, pi-1);
            sort(arr,a, pi+1, high);
        }
    }
    String inttobin(int n)
    {
        String s="";
        while(n!=0)
        {
            int d=n%2;
            s=d+s;
            n=n/2;
        }
        return s;
    }
    int bintoint(String S)
    {
        int p=0;
        for(int i=0;i<S.length();i++)
        {
            char c=S.charAt(i);
            if(c=='1')
                p+=Math.pow(2,i);
        }
        return p;
    }
    public static void main(String[] args) throws FileNotFoundException {
     try
     {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        templ ob=new templ();
        String s=in.nextLine();
        String s1=in.nextLine();
        int l=s.length();
        int l1=s1.length();
        int k=0;
        for(int i=0;i<l;i++)
        {
            char c=s.charAt(i);
            if(c=='1')
            k++;
        }
        int k1=0;
        for(int i=0;i<l1;i++)
        {
            char c=s1.charAt(i);
            if(c=='1')
                k1++;
        }
        int p;
        if(k%2==0)
        p=0;
        else
        p=1;
        if(p+k>=k1)
            out.println("YES");
        else
            out.println("NO");
        out.close();
    }
        catch(Exception e){
        return;
    }
    }
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }
} 	