#00048F

BubbleMatrix

A perfect matrix is a matrix with integer elements in which each two neighboring elements are relatively prime (co-prime), and the absolute value of each element is greater than one. Each element has up to four neighbors.

You are given a matrix A_(m×n) with integer elements a[i][j],1≤im,1≤jn.

Check if there exists a perfect matrixB_(m×n) where b[i][j] divides a[i][j] for every 1≤im,1≤jn.



InputThe first line contains positive integers m,n (1≤m,n≤80) — the dimensions of the matrix A_(m×n). Each of the next m lines contains a sequence of n integers separated by spaces, representing elements a[i][j] (2≤|a[i[j]|≤1000) of the matrix A_(m×n).


OutputOutput consists of one digit: “yes” (without quotes) if a perfect matrix exists; “no” if it doesn’t exist.



Input:
2 2
6 4
10 9

Output:
yes




Input:
1 3
4 6 9

Output:
no



Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.