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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Atharva Nagarkar
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        JoltyScanner in = new JoltyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DVasyaAndTheMatrix solver = new DVasyaAndTheMatrix();
        solver.solve(1, in, out);
        out.close();
    }

    static class DVasyaAndTheMatrix {
        public void solve(int testNumber, JoltyScanner in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            int[] rows = new int[n];
            int[] cols = new int[m];
            for (int i = 0; i < n; ++i) rows[i] = in.nextInt();
            for (int i = 0; i < m; ++i) cols[i] = in.nextInt();
            int[][] grid = new int[n][m];
            int[] xorRow = new int[n];
            int[] xorCol = new int[m];
            grid[0][0] = xorCol[0] = xorRow[0] = Math.max((Integer.highestOneBit(cols[0]) << 1) - 1, 0);
            boolean possible = true;
            for (int r = 0; possible && r < n; ++r) {
                for (int c = 0; possible && c < m; ++c) {
                    if (r == 0 && c == 0) continue;
                    int rowRemain = rows[r] ^ xorRow[r];
                    int colRemain = cols[c] ^ xorCol[c];
                    if (r == n - 1 && c == m - 1 && rowRemain != colRemain) {
                        possible = false;
                        continue;
                    }
                    if (c == m - 1) {
                        grid[r][c] = rowRemain;
                        xorRow[r] ^= rowRemain;
                        xorCol[c] ^= rowRemain;
                    } else {
                        grid[r][c] = colRemain;
                        xorRow[r] ^= colRemain;
                        xorCol[c] ^= colRemain;
                    }
                }
            }
            for (int r = 0; r < n; ++r) if (rows[r] != xorRow[r]) possible = false;
            for (int c = 0; c < m; ++c) if (cols[c] != xorCol[c]) possible = false;
            if (!possible) {
                out.println("NO");
                return;
            }
            out.println("YES");
            for (int r = 0; r < n; ++r) {
                for (int c = 0; c < m; ++c) {
                    out.print(grid[r][c] + " ");
                }
                out.println();
            }
        }

    }

    static class JoltyScanner {
        public int BS = 1 << 16;
        public char NC = (char) 0;
        public byte[] buf = new byte[BS];
        public int bId = 0;
        public int size = 0;
        public char c = NC;
        public double num = 1;
        public BufferedInputStream in;

        public JoltyScanner(InputStream is) {
            in = new BufferedInputStream(is, BS);
        }

        public JoltyScanner(String s) throws FileNotFoundException {
            in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
        }

        public char nextChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public long nextLong() {
            num = 1;
            boolean neg = false;
            if (c == NC) c = nextChar();
            for (; (c < '0' || c > '9'); c = nextChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = nextChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                num *= 10;
            }
            return neg ? -res : res;
        }

    }
}