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.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    class GraphBuilder {
        int n, m;
        int[] x, y;
        int index;
        int[] size;


        GraphBuilder(int n, int m) {
            this.n = n;
            this.m = m;
            x = new int[m];
            y = new int[m];
            size = new int[n];
        }

        void add(int u, int v) {
            x[index] = u;
            y[index] = v;
            size[u]++;
            size[v]++;
            index++;
        }

        int[][] build() {
            int[][] graph = new int[n][];
            for (int i = 0; i < n; i++) {
                graph[i] = new int[size[i]];
            }
            for (int i = index - 1; i >= 0; i--) {
                int u = x[i];
                int v = y[i];
                graph[u][--size[u]] = v;
                graph[v][--size[v]] = u;
            }
            return graph;
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readLongArray(int size) throws IOException {
        long[] res = new long[size];
        for (int i = 0; i < size; i++) {
            res[i] = readLong();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Template().run();
        // new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void solve() throws IOException {
        String s = readString();
        String t = readString();
        out.println(fullSolve(s, t) ? "YES" : "NO");
        //out.println(recur(s, t, 0) ? "YES" : "NO");
//        while (true) {
//            s = gen();
//            t = gen();
//            if (fullSolve(s, t) != recur(s, t, 0)) {
//                throw new RuntimeException(s + " " + t);
//            }
//        }
    }

    Random rnd = new Random();

    String gen() {
        int len = rnd.nextInt(4) + 1;
        String s = "";
        while (len --> 0) {
            s += rnd.nextInt(2);
        }
        return s;
    }

    boolean recur(String s, String t, int it) {
        if (it > 20) return false;
        if (s.equals(t)) return true;
        if (s.length() > 0 && recur(s.substring(1), t, it + 1)) return true;
        int ones = 0;
        for (char x : s.toCharArray()) {
            if (x == '1') ones++;
        }
        ones %= 2;
        s = s + ones;
        return recur(s, t, it + 1);
    }

    boolean fullSolve(String s, String t) {
        if (solve(s, t)) return true;
        int ones = 0;
        for (char x : s.toCharArray()) {
            if (x == '1') {
                ones++;
            }
        }
        s += ones % 2;
        return solve(s, t);
    }

    boolean solve(String s, String t) {
        char[] a = s.toCharArray();
        char[] b = t.toCharArray();
        int ones = 0;
        for (char x : a) {
            if (x == '1') {
                ones++;
            }
        }
        int sones = ones;
        for (int sufflen = 0; sufflen <= a.length; sufflen++) {
            ones = sones;
            if (sufflen > b.length) continue;
            boolean prefEq = true;
            for (int i = sufflen - 1; i >= 0; i--) {
                if (b[i] != a[a.length - sufflen + i]) {
                    prefEq = false;
                    break;
                }
            }
            if (!prefEq) continue;
            ArrayDeque<Character> deque = new ArrayDeque<>();
            for (int i = 0; i < a.length - sufflen; i++) {
                deque.add(a[i]);
            }
            boolean failed = false;
            for (int i = sufflen; i < b.length; i++) {
                while (true) {
                    if ((b[i] - '0') == ones % 2) {
                        if (b[i] == '1') {
                            ones++;
                        }
                        break;
                    } else {
                        if (deque.size() == 0) {
                            failed = true;
                            break;
                        } else {
                            char x = deque.pollFirst();
                            if (x == '1') {
                                ones--;
                            }
                        }
                    }
                }
            }
            if (!failed) {
                return true;
            }
        }
        return false;
    }

}