h,w=map(int,input().split())
s=[]
white=[]
for i in range(w):
  white.append(".")
s.append(white)
for i in range(h):
  a=[]
  a.append(".")
  for j in range(w):
    wh=list(map(int,input().split()))
    a.append(wh)
  a.append(".")
s.append(white)

for i in range(1,h+1):
  for j in range(1,w+1):
    if s[w-1][h]=="." and s[w+1][h]=="." and s[w][h-1]=="." and s[w][h+1]=="."
      print("No")
      exit()
print("Yes")