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:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//   package f.pkg1;

import java.io.*;
import java.util.*;

/**
 *
 * @author Mostafa
 */
public class F1 {

    /**
     * @param args the command line arguments
     */
    
    public static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
 public static PrintWriter out;
    
    public static int ser ( int x[] , int start , int end , int val )
    {
        while ( start <= end )
	{
            int mid = ( start + end ) / 2 ;
            if ( x[ mid ] <= val )
                start = mid + 1 ;
            else
                end = mid - 1 ;
	}
        return end ;
    }
    
    public static  boolean isPrime( long n)
    {
        if (n < 2)  return false;
        if (n < 4)  return true;

        if (n%2 == 0 || n%3 == 0) return false;

        for (long i=5; i*i<=n; i=i+6)
            if (n%i == 0 || n%(i+2) == 0)
                return false;

        return true;
    }  
    public static int search( int x[] , int val )
    {
        return ser( x , 0 , x.length - 1 , val );
    }
    
    
    public static int coin ( int rem , int ind , int c[] )
    {
        if ( rem == 0 )
            return 1 ;
        if ( ind == c.length || c[ind] > rem )
            return 0 ;
        return  coin( rem , ind + 1 , c ) + coin( rem - c[ind] , ind , c ) ;
    }
    public static int retur ( int rem , int ind , int c )
    {
        if ( rem == ind )
            return c ;
        return  retur( rem*2 , ind , c+1 ) + retur( rem - 1 , ind , c+1 ) ;
    }
//    for (Map.Entry<Integer, Integer> e : x.entrySet()) 
//            {
//                e.getValue() , e.getKey
    public static void main(String[] args) {
        // TODO code application logic here
        FastReader in = new FastReader();
        StringBuilder r = new StringBuilder();
        out = new PrintWriter(new BufferedOutputStream(System.out) , true );
        int ro = in.nextInt()  , co = in.nextInt() ;
        long row[] = new long [ro] ;
        long col[] = new long [co];
        long h = 0 , hh = 0 ;
        for ( int i = 0 ; i < ro ; ++i )
        {
            row[i] = in.nextLong() ;
            h ^= row[i] ;
        }
        for ( int i = 0 ; i < co ; ++i )
        {
            col[i] = in.nextLong() ;
            hh ^= col[i] ;
        }
        if ( h != hh )
        {
            out.println("NO");
            return ;
        }
        for ( int i = 0 ; i < ro - 1 ; ++i )
        {
            r.append(row[i] + " ");
            for ( int j = 1 ; j < co ; ++j )
                r.append("0 ");
            r.append("\n");
        }
        h ^= row[ro-1] ^ col[0];
        r.append(h + " ");
        for ( int i = 1 ; i < co ; ++i )
            r.append(col[i] + " ");
        out.println("YES\n"+r);
    }
}