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 a_1, a_2, ..., a_{n} 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 b_1, b_2, ..., b_{m} 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 a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 10^9), where a_{i} is the xor of all elements in row i.

The third line contains m numbers b_1, b_2, ..., b_{m} (0 ≤ b_{i} ≤ 10^9), where b_{i} 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 c_{i}1, c_{i}2, ... , c_{im} (0 ≤ c_{ij} ≤ 2·10^9) — 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

Difficulty: interview

Starter code:

Solutions:
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
t1, t2 = 0, 0
for i in a:
    t1 ^= i
for i in b:
    t2 ^= i
if t1 != t2:
    print('NO')
else:
    print('YES')
    for i in range(n-1):
        for j in range(m-1):
            print(0, end=' ')
        print(a[i])
    tmp = 0
    for j in range(m-1):
        print(b[j], end=' ')
        tmp ^= b[j]
    print(a[n-1]^tmp)


n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x, y = b[-1], a[-1]
for i in range(n - 1):
    x ^= a[i]
for j in range(m - 1):
    y ^= b[j]
if x != y:
    print('NO')
else:
    print('YES')
    for i in range(n - 1):
        for j in range(m - 1):
            print(0, end=' ')
        print(a[i])
    for j in range(m - 1):
        print(b[j], end=' ')
    print(x)


import sys
import io

stream_enable = 0

inpstream = """
2 3
2 9
5 3 13
"""

if stream_enable:
    sys.stdin = io.StringIO(inpstream)
    input()

def inpmap():
    return list(map(int, input().split()))

n, m = inpmap()
a = inpmap()
b = inpmap()
x = b[-1]
for t in a[:-1]:
    x ^= t
y = a[-1]
for t in b[:-1]:
    y ^= t
if (x == y):
    print("YES")
else:
    print("NO")
    return
for i in range(n - 1):
    print("0 " * (m - 1), end='')
    print(a[i])
print(*b[:-1], end=(' ' if len(b) > 1 else ''))
print(x)


# from math import ceil
#from sys import stdout

t = 1#int(input())
for test in range(1,t+1):
    n,m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    arr = [[0 for i in range(m)] for j in range(n)]
    tmp = 0
    for i in a:
        tmp = tmp^i
    for i in b:
        tmp = tmp^i
    if tmp != 0:
        print("NO")
    else:
        print("YES")
        row = 0
        while row < n-1:
            arr[row][-1] = a[row]
            b[m-1] = a[row]^b[m-1]
            row+=1
        for i in range(m):
            arr[n-1][i] = b[i]

        for i in range(n):
            print(*arr[i])

    
    














    


#!/usr/bin/env python3
from sys import stdin, stdout

def rint():
    return list(map(int, stdin.readline().split()))
#lines = stdin.readlines()


n,m = rint()

a = list(rint())
b = list(rint())

ans = [[0 for i in range(m)] for j in range(n)]

for i in range(n):
    if i != n-1:
        for j in range(m-1):
            ans[i][j] = 0
        ans[i][m-1] = a[i]
    else:
        for j in range(m-1):
            ans[i][j] = b[j]
        row_xor = 0
        for j in range(m-1):
            row_xor = row_xor^ans[i][j]
        col_xor = 0
        for j in range(n-1):
            col_xor = col_xor^ans[j][m-1]
        if row_xor^a[n-1] == col_xor^b[m-1]:
            ans[i][m-1] = row_xor^a[n-1]
        else:
            print("NO")
            return

print("YES")
for i in range(n):
    print(*ans[i])



I=input
P=print
R=range
I()
a=[int(i)for i in I().split()]
b=[int(i)for i in I().split()]
n=len(a)
m=len(b)
x=b[-1]
for i in R(n-1):x^=a[i]
y=a[-1]
for i in R(m-1):y^=b[i]
if x!=y:P("NO");return
P("YES")
for i in R(n-1):
    for _ in R(m-1):P("0",end=" ")
    P(a[i])
for i in R(m-1):P(b[i],end=" ")
P(x)

I=input
P=print
R=range
I()
a=[int(i)for i in I().split()]
b=[int(i)for i in I().split()]
n=len(a)
m=len(b)
x=b[-1]
for i in R(n-1):x^=a[i]
y=a[-1]
for i in R(m-1):y^=b[i]
if x!=y:P("NO");return
P("YES")
for i in R(n-1):
    for _ in R(m-1):P("0",end=" ")
    P(a[i])
for i in R(m-1):P(b[i],end=" ")
P(x)

I=input
P=print
R=range
I()
a=[int(i)for i in I().split()]
b=[int(i)for i in I().split()]
n=len(a)
m=len(b)
x=b[-1]
for i in R(n-1):x^=a[i]
y=a[-1]
for i in R(m-1):y^=b[i]
if x!=y:P("NO");return
P("YES")
for i in R(n-1):P("0 "*(m-1)+str(a[i]))
for i in R(m-1):P(b[i],end=" ")
P(x)