import numpy as np
h, w = map(int, input().split())
s = np.array([list(input()) for _ in range(h)])
w1, w2 = np.array(["."]*w), np.array(["."]*(h+2))
s = np.hstack((w1, s))
s = np.hstack((s, w1))
s = np.vstack((w2.reshape(len(w2),1), s))
s = np.vstack((s, w2.reshape(len(w2),1)))
dx, dy = [1, 0, -1, 0], [0, 1, 0, -1]
for i in range(1, h+1, 1):
    for j in range(1, w+1, 1):
        now = s[i][j]
        c = 0
        if now == ".":
            continue
        for d in range(4):
            x = j + dx[d]
            y = i + dy[d]
            if now == s[y][x]:
                c += 1
        if c == 0:
            print("No")
            exit()
print("Yes")