n,m = map(int,input().split()) desk = [list(input().strip()) for _ in range(n)] x,y = 0,0 pos = [(0,0)] dirs = [(1,0),(0,1),(-1,0),(0,-1)] while True: if x==n-1 and y ==m-1 : # 走到出口,返回Yes print('Yes') break desk[x][y] = 'x'#标记走过的路 for dx,dy in dirs: nx,ny = dx+x,dy+y #尝试找能走的路 if 0<=nx<n and 0<=ny<m and desk[nx][ny] =='.': x,y = nx,ny pos.append((x,y)) break # 一旦找到,就提前返回 else: x,y = pos.pop() # 如果没有提前返回,说明当前是死胡同,回退到上一步 if len(pos)==0: # 如果已经回退到起点,说明无解 print("No") break