H, W = map(int, raw_input().split()) s = [raw_input() for i in xrange(H)] dxdy = [(i, j) for i in xrange(H) for j in xrange(W)] dxdy.pop(0) xy = [(i, j) for i in xrange(H) for j in xrange(W)] for dx, dy in dxdy: taiou = set() print dx, dy for x, y in xy: if s[x][y] == '.': continue nx, ny = x+dx, y+dy if (x, y) in taiou: continue if nx >= H or ny >= W or s[nx][ny] == '.': break taiou.add((nx, ny)) else: print 'YES' break else: print 'NO'