n , m = map(int,input().split())
arr = []
for i in range(n):
arr.append(list(input()))
graph = {}
for i in range(n):
for j in range(m):
if arr[i][j] == ".":
graph[(i,j)] = []
if i - 1 >= 0 and arr[i-1][j]==".":
graph[(i,j)].append((i-1,j))
if j - 1 >= 0 and arr[i][j-1]==".":
graph[(i,j)].append((i,j-1))
if j + 1 <= m - 1 and arr[i][j+1]==".":
graph[(i,j)].append((i,j+1))
if i + 1 <= n - 1 and arr[i+1][j]==".":
graph[(i,j)].append((i+1,j))
# print(graph)
def can_reach(graph, start, target):
stack = [start]
visited = set()
while stack:
current = stack.pop()
if current == target:
return "Yes"
if current in visited:
continue
visited.add(current)
for neighbor in graph[current]:
if neighbor not in visited:
stack.append(neighbor)
return "No"
print(can_reach(graph,(0,0),(n-1,m-1)))