import sequtils, strutils, sugar var h, w: int (h, w) = stdin.readLine.split.map parseInt let ss = (0 ..< h).mapIt stdin.readLine proc fn(s: string): seq[int] = collect newSeq: for i, c in s: if c == '#': i let ss2 = ss.map fn idxs = collect newSeq: for i, xs in ss2: for x in xs: (i, x) length = idxs.len proc sub(list: var seq[int], val: int): void = var idx = 0 for i, v in list: if val == v: idx = i list.del idx proc fn2(dist: (int, int)): bool = var xs = ss2 cnt = 0 for (i, j) in idxs: if j notin xs[i]: continue let i2 = i.succ dist[0] j2 = j.succ dist[1] if i2 < 0 or i2 >= h or j2 < 0 or j2 >= w: continue if j2 notin xs[i2]: return false sub(xs[i], j) sub(xs[i.succ dist[0]], j.succ dist[1]) inc cnt if cnt == length div 2: return true if length == 0 or length mod 2 == 1: echo "NO" else: var b: bool let list = idxs[1 ..< length] for (i, j) in list: let dist = (i.pred idxs[0][0],j.pred idxs[0][1]) b = fn2 dist if b: break if b: echo "YES" else: echo "NO"