Problem: Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!

Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1, a2, ..., an denotes the xor of elements in rows with indices 1, 2, ..., n, respectively. Similarly, for each column, he knows the xor of the elements in this column. The sequence b1, b2, ..., bm denotes the xor of elements in columns with indices 1, 2, ..., m, respectively.

Help Vasya! Find a matrix satisfying the given constraints or tell him that there is no suitable matrix.

Input

The first line contains two numbers n and m (2 ≤ n, m ≤ 100) — the dimensions of the matrix.

The second line contains n numbers a1, a2, ..., an (0 ≤ ai ≤ 109), where ai is the xor of all elements in row i.

The third line contains m numbers b1, b2, ..., bm (0 ≤ bi ≤ 109), where bi is the xor of all elements in column i.

Output

If there is no matrix satisfying the given constraints in the first line, output "NO".

Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1, ci2, ... , cim (0 ≤ cij ≤ 2·109) — the description of the matrix.

If there are several suitable matrices, it is allowed to print any of them.

Examples

Input

2 3
2 9
5 3 13


Output

YES
3 4 5
6 7 8


Input

3 3
1 7 6
2 15 12


Output

NO

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Main {
    private static class Solver {

        private void Solve() {
            int n = inp.nextInt();
            int m = inp.nextInt();
            int[] a = inp.nextIntArray(n);
            int[] b = inp.nextIntArray(m);

            int[][] ans = new int[n][m];
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    ans[i][j] = 0;
                }
            }
            for (int bit = 0; bit < 30; ++bit) {
                int[] ta = new int[n];
                int[] tb = new int[m];
                int sa = 0;
                int sb = 0;
                for (int i = 0; i < n; ++i) {
                    ta[i] = a[i] >> bit & 1;
                    sa += ta[i];
                }
                for (int i = 0; i < m; ++i) {
                    tb[i] = b[i] >> bit & 1;
                    sb += tb[i];
                }
                if (sa % 2 != sb % 2) {
                    out.println("NO");
                    return;
                }
                for (int i = 0; i < n; ++i) {
                    if (ta[i] == 0) {
                        continue;
                    }
                    for (int j = 0; j < m; ++j) {
                        if (tb[j] == 0) {
                            continue;
                        }
                        ans[i][j] |= 1 << bit;
                        tb[j] = 0;
                        ta[i] = 0;
                        break;
                    }
                }
                int f = -1;
                for (int i = 0; i < n; ++i) {
                    if (ta[i] > 0) {
                        f = 0;
                        break;
                    }
                }
                for (int i = 0; i < m; ++i) {
                    if (tb[i] > 0) {
                        if (f == 0) {
                            out.println("WUT");
                        }
                        f = 1;
                        break;
                    }
                }
                if (f == 0) {
                    for (int i = 0; i < n; ++i) {
                        if (ta[i] == 0) {
                            continue;
                        }
                        ans[i][0] |= 1 << bit;
                    }
                } else if (f == 1) {
                    for (int i = 0; i < m; ++i) {
                        if (tb[i] == 0) {
                            continue;
                        }
                        ans[0][i] |= 1 << bit;
                    }
                }
            }

            out.println("YES");
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    out.print(ans[i][j] + " ");
                }
                out.println("");
            }
        }
        static InputReader inp;
        static PrintWriter out;
    }

    private static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        private InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        private String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }
        private long nextLong() {
            return Long.parseLong(next());
        }
        private int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = nextInt();
            }
            return a;
        }
    }
    public static void main(String[] args) throws IOException {
        if (!"true".equals(System.getProperty("ONLINE_JUDGE"))) {
            System.setIn(new FileInputStream(new File("input.txt")));
        }
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Solver.inp = new InputReader(inputStream);
        Solver.out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.Solve();
        Solver.out.close();
    }
}