There is a rectangular grid of n rows of m initially-white cells each.

Arkady performed a certain number (possibly zero) of operations on it. In the i-th operation, a non-empty subset of rows R_{i} and a non-empty subset of columns C_{i} are chosen. For each row r in R_{i} and each column c in C_{i}, the intersection of row r and column c is coloured black.

There's another constraint: a row or a column can only be chosen at most once among all operations. In other words, it means that no pair of (i, j) (i < j) exists such that $R_{i} \cap R_{j} \neq \varnothing$ or $C_{i} \cap C_{j} \neq \varnothing$, where [Image] denotes intersection of sets, and $\varnothing$ denotes the empty set.

You are to determine whether a valid sequence of operations exists that produces a given final grid.


-----Input-----

The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 50) — the number of rows and columns of the grid, respectively.

Each of the following n lines contains a string of m characters, each being either '.' (denoting a white cell) or '#' (denoting a black cell), representing the desired setup.


-----Output-----

If the given grid can be achieved by any valid sequence of operations, output "Yes"; otherwise output "No" (both without quotes).

You can print each character in any case (upper or lower).


-----Examples-----
Input
5 8
.#.#..#.
.....#..
.#.#..#.
#.#....#
.....#..

Output
Yes

Input
5 5
..#..
..#..
#####
..#..
..#..

Output
No

Input
5 9
........#
#........
..##.#...
.......#.
....#.#.#

Output
No



-----Note-----

For the first example, the desired setup can be produced by 3 operations, as is shown below.

 [Image] 

For the second example, the desired setup cannot be produced, since in order to colour the center row, the third row and all columns must be selected in one operation, but after that no column can be selected again, hence it won't be possible to colour the other cells in the center column.

Difficulty: interview

Starter code:

Solutions:
n, m = list(map(int, input().split()))
a = [-1] * m
b = []
f = True
for i in range(n):
    s = input()
    q = set()
    for j in range(len(s)):
        if (s[j] == "#"):
            q.add(j)
    for j in range(len(s)):
        if (s[j] == "#"):
            if (a[j] == -1):
                a[j] = i
            else:
                if b[a[j]] != q:
                    f = False
    b.append(q)
    #print(a, b, f)
if f:
    print("Yes")
else:
    print("No")


# python3

def readline(): return tuple(map(int, input().split()))


def main():
    n, m = readline()
    unique_rows = list()

    first_occ = [None] * m

    while n:
        n -= 1
        row = input()
        saved = None
        for (i, char) in enumerate(row):
            if char == '#':
                if first_occ[i] is not None:
                    if row != unique_rows[first_occ[i]]:
                        return False
                    else:
                        break
                else:
                    if saved is None:
                        unique_rows.append(row)
                        saved = len(unique_rows) - 1
                    first_occ[i] = saved
            else:
                assert char == '.'

    return True


print("Yes" if main() else "No")


# python3
n, m = tuple(map(int, input().split()))

mask = 0
collected = set()

while n:
    n -= 1

    row = 0
    for char in input():
        row = (row << 1) | (char == '#')

    if row & mask:
        if row not in collected:
            print("No")
            break
    else:
        mask ^= row
        collected.add(row)
else:
    print("Yes")


def read_data():
    n, m = list(map(int, input().strip().split()))
    a = []
    for i in range(n):
        line = list(input().strip())
        for j in range(len(line)):
            if line[j] == ".":
                line[j] = 0
            else:
                line[j] = 1
        a.append(line)
    return n, m, a

def get_step(i,j):
    rows = []
    cols = []
    for k in range(m):
        if a[i][k] == 1:
            cols.append(k)
            if k in usedc:
                return "No"
            else:
                usedc.append(k)
    for k in range(n):
        if a[k][j] == 1:
            rows.append(k)
            if k in usedr:
                return "No"
            else:
                usedr.append(k)
    for row in rows:
        for col in cols:
            if a[row][col] == 0:
                return "No"
            else:
                a[row][col] = 0
    return "Ok"

def solve():
    for i in range(n):
        for j in range(m):
            if a[i][j] == 1:
                step = get_step(i,j)
                if step == "No":
                    return "No"
    return "Yes"

n, m, a = read_data()
usedr = []
usedc = []
print(solve())


n, m = map(int, input().split())
s = {input() for i in range(n)}
print('No' if any(sum(si[j] == '#' for si in s) > 1 for j in range(m)) else 'Yes')

def main():
    n, m = list(map(int, input().split()))
    aa, bb = [{i for i, c in enumerate(input()) if c == '#'} for _ in range(n)], []
    for a in aa:
        if a:
            for b in bb:
                c = a & b
                if c and a != b:
                    print('No')
                    return
            bb.append(a)
    print('Yes')


def __starting_point():
    main()

__starting_point()

t=set(input()for _ in [0]*int(input().split()[0]))
print(['No','Yes'][all(sum(c<'.'for c in s)<2for s in zip(*t))])



# Made By Mostafa_Khaled


BLACK, WHITE = "#", "."
n, m = list(map(int, input().split()))
blacks = [{i for i, c in enumerate(input()) if c == BLACK} for i in range(n)]
answer = "Yes"
for i in range(n):
    for j in range(i):
        if blacks[i] & blacks[j] and blacks[i] != blacks[j]:
            answer = "No"
print(answer)

n = 0
m = 0


def esht(a, b ):

    nonlocal n, m

    for ptr in range(0 ,len(a)):
        if (a[ptr] is '#') and (a[ptr] == b[ptr]):
            return True
    return False

def main():
    nonlocal n , m
    n, m = [*list(map(int,input().split()))]
    s = ["" for i in range(0,n)]
    for i in range(0,n):
        s[i] = input()
    ans = True
    for i in range(0,n):
        for j in range(i + 1 , n):
            if esht(s[i], s[j]) and s[i] != s[j]:
                ans = False
    if ans is True:
        print("Yes")
    else:
        print("No")

main()


n, m = [int(i) for i in input().split()]
a, b, flag = [-1] * m, list(), True
for i in range(n):
    s = input()
    q = set()
    for j in range(len(s)):
        if s[j] == "#":
            q.add(j)
    for j in range(len(s)):
        if s[j] == "#":
            if a[j] == -1:
                a[j] = i
            else:
                if b[a[j]] != q:
                    flag = False
    b.append(q)
if flag:
    print("Yes")
else:
    print("No")


n, m = list(map(int, input().split()))
s = [input() for _ in range(n)]
l = []

for i in range(n):
    se = set()
    
    for j in range(m):
        if s[i][j]=='#':
            se.add(j)

    for li in l:
        if len(se&li)!=0 and se!=li:
            print('No')
            return
    
    l.append(se)
    
print('Yes')


n, m = map(int, input().split())
t = [0]*n

for j in range(n):
    s = input()
    for i in range(len(s)):
        t[j] += int(s[i] == "#")
        t[j] *= 2
        
ans = True
for i in range(n):
    for j in range(i + 1, n):
        if (t[i] & t[j]) != 0:
            if t[i] != t[j]:
                ans = False

if ans:
    print("Yes")
else:
    print("No")

n, m = map(int, input().split())
t = [0]*n

for j in range(n):
    s = input()
    for i in range(len(s)):
        t[j] += int(s[i] == "#")
        t[j] *= 2
        
ans = True
for i in range(n):
    for j in range(i + 1, n):
        if (t[i] & t[j]) != 0:
            if t[i] != t[j]:
                ans = False

if ans:
    print("Yes")
else:
    print("No")