h, w = map(int, input().split())
s = [list(input()) for i in range(h)]

flag = 0

for j in range(1, h-1):
  for k in range(1, w-1):
    print(j,k)
    print(s[j][k],s[j+1][k],s[j-1][k],s[j][k+1],s[j][k-1])
    if s[j][k] != s[j+1][k] or s[j][k] != s[j-1][k] or s[j][k] != s[j][k+1] or s[j][k] != s[j][k-1]:
      flag += 1
      
if flag > 1:
  print("No")
else:
  print("Yes")