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.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * @author Polyarniy Nickolay
 */
public class ProblemA {

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok;
    private final String DELIMETER = " ";
    private final boolean ENABLE_MULTITEST = false;
    private final boolean DEBUG = true;
    private final String FILENAME = null;//if FILENAME = null, then works with console

    public void run() throws Exception {
        initInputOutput();
        do {
            init();
            solve();
        } while (hasMoreTokens() && ENABLE_MULTITEST);
        finish();
    }

    private void init() throws Exception {
    }

    private void solve() throws Exception {
        String a = nextWord();
        String b = nextWord();
//        if (b.indexOf('1') != -1 && a.indexOf('1') == -1) {
//            out.println("NO");
//        } else {
        int aCount1 = 0;
        int aCount0 = a.length();
        int bCount1 = 0;
        int bCount0 = b.length();
        for (int i = 0; i < a.length(); i++) {
            if (a.charAt(i) == '1') {
                aCount1++;
                aCount0--;
            }
        }
        for (int i = 0; i < b.length(); i++) {
            if (b.charAt(i) == '1') {
                bCount1++;
                bCount0--;
            }
        }
        if (aCount1 % 2 == 0) {
            if (bCount1 > aCount1) {
                out.println("NO");
            } else {
                out.println("YES");
            }
        } else {
            if (bCount1 > aCount1 + 1) {
                out.println("NO");
            } else {
                out.println("YES");
            }
        }
//        }
    }

    public static void main(String[] args) throws Exception {
        ProblemA solution = new ProblemA();
        solution.run();
    }

    private void initInputOutput() throws Exception {
        if (FILENAME == null) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    private void shuffleArray(Object[] arr) {
        Random r = new Random();
        for (int i = 0; i < arr.length; ++i) {
            Object tmp = arr[i];
            int j = r.nextInt(arr.length);
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    private void shuffleArray(int[] arr) {
        Random r = new Random();
        for (int i = 0; i < arr.length; ++i) {
            int tmp = arr[i];
            int j = r.nextInt(arr.length);
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    private int[] nextArrayInt(int n) throws Exception {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = nextInt();
        }
        return res;
    }

    private String nextWord() throws Exception {
        if (updateTokenizer()) {
            return null;
        } else {
            return tok.nextToken();
        }
    }

    private boolean hasMoreTokens() throws Exception {
        return !updateTokenizer();
    }

    private boolean updateTokenizer() throws Exception {
        while (tok == null || !tok.hasMoreTokens()) {
            String nextLine = in.readLine();
            if (nextLine == null || nextLine.isEmpty()) {
                return true;
            }
            tok = new StringTokenizer(nextLine, DELIMETER);
        }
        return false;
    }

    private int nextInt() throws Exception {
        return Integer.parseInt(nextWord());
    }

    private long nextLong() throws Exception {
        return Long.parseLong(nextWord());
    }

    private void finish() throws Exception {
        in.close();
        out.close();
    }

    private void print(String s) {
        if (DEBUG) {
            System.out.print(s);
        }
    }

    private void println(String s) {
        if (DEBUG) {
            System.out.println(s);
        }
    }

    private void println() {
        if (DEBUG) {
            System.out.println();
        }
    }

    private long[] getFirstSimpleNums(int n) {
        boolean[] notPr = new boolean[n];
        int res = n;
        notPr[0] = true;
        res--;
        notPr[1] = true;
        res--;
        for (int i = 2; i < n; ++i) {
            if (!notPr[i]) {
                for (int j = i + i; j < n; j += i) {
                    if (!notPr[j]) {
                        notPr[j] = true;
                        res--;
                    }
                }
            }
        }
        long[] resA = new long[res];
        int next = 0;
        for (int i = 0; i < n; i++) {
            if (!notPr[i]) {
                resA[next] = i;
                next++;
            }
        }
        return resA;
    }

    private static class Pair {

        int a;
        int b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }
        public static final Comparator<Pair> comparator = new Comparator<Pair>() {

            @Override
            public int compare(Pair pair1, Pair pair2) {
                return (pair1.a - pair2.a) != 0 ? (pair1.a - pair2.a) : (pair1.b - pair2.b);
            }
        };

        @Override
        public String toString() {
            return "{" + a + "|" + b + '}';
        }
    }

    class TreeMin {

        int n;
        int[] t;

        public TreeMin(int size, int[] defaultValue) {
            n = 1;
            while (n < size) {
                n *= 2;
            }
            t = new int[2 * n];
            for (int i = 0; i < defaultValue.length; i++) {
                t[n + i] = defaultValue[i];
            }
            for (int i = defaultValue.length; i < n; i++) {
                t[n + i] = Integer.MAX_VALUE;
            }
            for (int i = n - 1; i >= 1; i--) {
                t[i] = Math.min(t[2 * i], t[2 * i + 1]);
            }
        }

        public void set(int index, int value) {
            index += n;
            t[index] = value;
            index /= 2;
            while (index >= 1) {
                t[index] = Math.min(t[2 * index], t[2 * index + 1]);
                index /= 2;
            }
        }

        /**
         * @param l inclusive
         * @param r exclusive
         */
        public int getMin(int l, int r) {
            int min = Integer.MAX_VALUE;
            l += n;
            r += n;
            while (l <= r) {
                if (l % 2 == 1) {
                    min = Math.min(min, t[l]);
                    l++;
                }
                if (r % 2 == 0) {
                    min = Math.min(min, t[r]);
                    r--;
                }
                l /= 2;
                r /= 2;
            }
            return min;
        }
    }

    class PriorityQueue {

        int size = 0;
        int capacity = 5;
        int[] key = new int[capacity];
        int[] value = new int[capacity];
        int[] idByInd = new int[capacity];
        int nextID = 0;
        ArrayList<Integer> indById = new ArrayList<Integer>();

        void ensureCapacity(int newSize) {
            if (newSize > capacity) {
                key = increaseArray(key);
                value = increaseArray(value);
                idByInd = increaseArray(idByInd);
                capacity = key.length;
            }
        }

        int[] increaseArray(int[] a) {
            int[] res = new int[Math.max(a.length * 2, 1)];
            for (int i = 0; i < a.length; i++) {
                res[i] = a[i];
            }
            for (int i = a.length; i < res.length; i++) {
                res[i] = Integer.MAX_VALUE;
            }
            return res;
        }

        void swap(int ind1, int ind2) {
            swap(key, ind1, ind2);
            swap(value, ind1, ind2);
            int id1 = idByInd[ind1];
            int id2 = idByInd[ind2];
            swap(idByInd, ind1, ind2);
            swap(indById, id1, id2);
        }

        void swap(int[] a, int ind1, int ind2) {
            int tmp = a[ind1];
            a[ind1] = a[ind2];
            a[ind2] = tmp;
        }

        void swap(ArrayList<Integer> a, int ind1, int ind2) {
            int tmp = a.get(ind1);
            a.set(ind1, a.get(ind2));
            a.set(ind2, tmp);
        }

        int parent(int index) {
            return (index - 1) / 2;
        }

        private void siftUp(int index) {
            while (index > 0) {
                int parent = parent(index);
                if (key[index] < key[parent]) {
                    swap(index, parent);
                }
                index = parent;
            }
        }

        private void siftDown(int index) {
            while (true) {
                int ch1 = 2 * index + 1;
                int ch2 = 2 * index + 2;
                if (ch1 >= size) {
                    ch1 = index;
                }
                if (ch2 >= size) {
                    ch2 = ch1;
                }
                int toSwap = index;
                if (key[ch1] < key[toSwap]) {
                    toSwap = ch1;
                }
                if (key[ch2] < key[toSwap]) {
                    toSwap = ch2;
                }
                if (toSwap == index) {
                    break;
                } else {
                    swap(index, toSwap);
                    index = toSwap;
                }
            }
        }

        public int push(int key, int value) {
            size++;
            ensureCapacity(size);
            int id = nextID;
            nextID++;
            this.key[size - 1] = key;
            this.value[size - 1] = value;
            this.idByInd[size - 1] = id;
            indById.add(size - 1);
            siftUp(size - 1);
            return id;
        }

        public void decreaseKey(int id, int key) {
            int ind = indById.get(id);
            while (key > this.key[ind]) {
            }
            this.key[ind] = key;
            siftUp(ind);
        }
        public final int EMPTY = Integer.MIN_VALUE;

        public int extractMinKey() {
            if (size == 0) {
                return EMPTY;
            } else {
                int res = key[0];
                swap(0, size - 1);
                size--;
                siftDown(0);
                return res;
            }
        }
//        public String toString() {
//            String res = "{" + "size=" + size + "|k,v|";
//            for (int i = 0; i < size; i++) {
//                res += key[i]+"("+idByInd[i]+") ";// + "," + value[i];
//            }
//            res += "}";
//            return res;
//        }
    }
//    /**
//     * Examples(n: res):
//     * 0: 0
//     * 1: 0
//     * 2: 1
//     * 3: 2
//     * 4: 2
//     * 5: 3
//     * 7: 3
//     * 8: 3
//     * 10:4
//     */
//    public static int logCeil(int n) {
//        int res = 0;
//        int pow = 1;
//        while (pow < n) {
//            pow *= 2;
//            res++;
//        }
//        return res;
//    }
//
//    private static class Tree<T> {
//
//        Object[] t;
//        Object[] push;
//        int n;
//        int capacity;
//        TreeType<T> tree;
//
//        public Tree(int capacity, T[] a, TreeType<T> tree) {
//            this.tree = tree;
//            n = 1;
//            while (n < capacity) {
//                n *= 2;
//            }
//            t = new Object[2 * n];
//            push = new Object[n];
//            this.capacity = capacity;
//            System.arraycopy(a, 0, t, n, capacity);
//            for (int i = n - 1; i >= 1; i--) {
//                t[i] = tree.calc((T) t[i * 2], (T) t[i * 2 + 1]);
//            }
//        }
//
//        public T getOnRange(int l, int r) {
//            l += n;
//            r += n;
//            return getOnRange(l, r, 1, n, 2 * n - 1);
//        }
//
//        public T getOnRange(int l, int r, int cur, int rl, int rr) {
//            if (cur >= n) {
//                return (T) t[cur];
//            }
//            push(cur);
//            if (l == rl && r == rr) {
//                return (T) t[cur];
//            }
//            int m = (rl + rr) / 2;
//            T res = null;
//            if (l <= m) {
//                res = tree.sum(res, getOnRange(l, Math.min(m, r), 2 * cur, rl, m));
//            }
//            if (r >= m + 1) {
//                res = tree.sum(res, getOnRange(Math.max(m + 1, l), r, 2 * cur + 1, m + 1, rr));
//            }
//            return res;
//        }
//
//        public T get(int ind) {
//            int cur = 1;
//            int rl = n;
//            int rr = 2 * n - 1;
//            while (cur < n) {
//                push(cur);
//                int m = (rl + rr) / 2;
//                if (ind <= m) {
//                    cur = 2 * ind;
//                    rr = m;
//                } else {
//                    cur = 2 * ind + 1;
//                    rl = m + 1;
//                }
//            }
//            return (T) t[cur];
//        }
//
//        public void add(T x, int ind) {
//            int cur = 1;
//            int rl = n;
//            int rr = 2 * n - 1;
//            while (cur < n) {
//                push(cur);
//                int m = (rl + rr) / 2;
//                if (ind <= m) {
//                    cur = 2 * ind;
//                    rr = m;
//                } else {
//                    cur = 2 * ind + 1;
//                    rl = m + 1;
//                }
//            }
//            t[cur] = tree.calc((T) t[cur], x);
//        }
//
//        private void push(int cur) {
//            if (!tree.isEmpty((T) push[cur])) {
//                for (int ch = 0; ch <= 1; ch++) {
//                    if (2 * cur + ch < n) {
//                        push[2 * cur + ch] = tree.calc((T)push[2 * cur + ch], (T)push[cur]);
//                    } else {
//                        t[2 * cur + ch] = tree.calc((T)t[2 * cur + ch], (T)push[cur]);
//                    }
//                }
//                push[cur] = null;
//            }
//        }
//    }
//
//    private static interface TreeType<T> {
//
//        public T calc(T a, T b);
//
//        public boolean isEmpty(T push);
//    }
}