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.BufferedReader;
import java.io.IOException;
import java.util.*;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;

public class D1016 {
    static class OutputWriter {
        private final PrintWriter writer;
    
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
    
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
    
        public void print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(array[i]);
            }
        }
    
        public void printLine(int[] array) {
            print(array);
            writer.println();
        }
    
        public void close() {
            writer.close();
        }
    
    }

    static class Pair {
        int value;
        int index;
        Pair(int value, int index) {
            this.value = value;
            this.index = index;
        }
    }
    static class MyComparator implements Comparator<Pair> {
        @Override
        public int compare(Pair p1, Pair p2) {
            if (p1.value != p2.value) return p1.value - p2.value;
            return p1.index - p2.index;
        }
    }
    public static void main(String[] args) {
		OutputStream outputStream = System.out;
        OutputWriter out = new OutputWriter(outputStream);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc=  new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] rows = new int[n];
        int[] cols = new int[m];
        long rowxor = 0l;
        long colxor = 0l;
        long[][] result = new long[n][m];
        for (int i=0; i<n; i++) {
            rows[i] = sc.nextInt();
            rowxor ^= rows[i];
        }
        for (int i=0; i<m; i++) {
            cols[i] = sc.nextInt();
            colxor ^= cols[i];
        }
		if (rowxor != colxor) {
            System.out.println("NO");
        } else {
            long p = 0l;
            long[][] currxor = new long[n][m];
            //System.out.println("YES");
            for (int i=0; i<n-1; i++) {
                for (int j=0; j<m-1; j++) {
                    result[i][j] = 1l;
                }
            }
            long tempxor = 0l;
            if ((m-1)%2==0) tempxor = 0l;
            else tempxor = 1l;
            for (int i=0; i<n-1; i++) {
                result[i][m-1] = (long)(tempxor ^ rows[i]);
            }
            if ((n-1)%2==0) tempxor = 0l;
            else tempxor = 1l;
            for (int i=0; i<m-1; i++) {
                result[n-1][i] = tempxor ^ cols[i];
            }
            int flag = 0;
            tempxor = 0l;
            for (int i=0;i<n-1; i++) {
                tempxor ^= result[i][m-1];
            }
            long newtempxor = tempxor^cols[m-1];
            tempxor = 0l;
            for (int i=0;i<m-1; i++) {
                tempxor ^= result[n-1][i];
            }
            long newtempxor1 = tempxor^rows[n-1];
            if (newtempxor!=newtempxor1) {
                System.out.println("NO");
            } else {
                result[n-1][m-1] = newtempxor;
                System.out.println("YES");
                for (int i=0; i<n; i++) {
                    for (int j=0; j<m; j++) {
                        System.out.print(result[i][j] + " ");
                    }
                    System.out.println();
                }
            }
            
            /* 
            for (int i=0; i<n; i++) {
                for (int j=0; j<m; j++) {
                    if (i==n-1) {

                    } else if (j == m-1) {

                    } else {
                        if (i == 0) {
                            if (j==0) {
                                currxor[i][j] = 1l;
                            } else {
                                currxor[i][j] ^= currxor[i][j-1];
                            }
                        }
                        result[i][j] = 1;
                    }
                }
            }
            */
        }
        out.close();
    }
}