One day Alice was cleaning up her basement when she noticed something very curious: an infinite set of wooden pieces! Each piece was made of five square tiles, with four tiles adjacent to the fifth center tile:  [Image]  By the pieces lay a large square wooden board. The board is divided into $n^2$ cells arranged into $n$ rows and $n$ columns. Some of the cells are already occupied by single tiles stuck to it. The remaining cells are free.

Alice started wondering whether she could fill the board completely using the pieces she had found. Of course, each piece has to cover exactly five distinct cells of the board, no two pieces can overlap and every piece should fit in the board entirely, without some parts laying outside the board borders. The board however was too large for Alice to do the tiling by hand. Can you help determine if it's possible to fully tile the board?


-----Input-----

The first line of the input contains a single integer $n$ ($3 \leq n \leq 50$) — the size of the board.

The following $n$ lines describe the board. The $i$-th line ($1 \leq i \leq n$) contains a single string of length $n$. Its $j$-th character ($1 \leq j \leq n$) is equal to "." if the cell in the $i$-th row and the $j$-th column is free; it is equal to "#" if it's occupied.

You can assume that the board contains at least one free cell.


-----Output-----

Output YES if the board can be tiled by Alice's pieces, or NO otherwise. You can print each letter in any case (upper or lower).


-----Examples-----
Input
3
#.#
...
#.#

Output
YES

Input
4
##.#
#...
####
##.#

Output
NO

Input
5
#.###
....#
#....
###.#
#####

Output
YES

Input
5
#.###
....#
#....
....#
#..##

Output
NO



-----Note-----

The following sketches show the example boards and their tilings if such tilings exist:  [Image]

Difficulty: EASY
Tags: Implementation

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
n = int(input())
u = [['#'] * (n + 2)]
for i in range(n):
	u.append(['#'] + list(input()) + ['#'])
u.append(['#'] * (n + 2))
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if u[i][j] == '.':
			if u[i + 1][j] != '#' and u[i + 1][j - 1] != '#':
				u[i + 1][j] = '#'
				u[i + 1][j - 1] = '#'
			else:
				print('NO')
				exit()
			if u[i + 1][j + 1] != '#' and u[i + 2][j] != '#':
				u[i + 1][j + 1] = '#'
				u[i + 2][j] = '#'
			else:
				print('NO')
				exit()
print('YES')


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
a = []
for i in range(n):
	b = si()
	a.append(list(b))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i][j + 1] == '.' and (a[i][j - 1] == '.'):
			if a[i - 1][j] == '.' and a[i + 1][j] == '.':
				a[i - 1][j] = '#'
				a[i + 1][j] = '#'
				a[i][j] = '#'
				a[i][j - 1] = '#'
				a[i][j + 1] = '#'
f = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			f = 1
			break
	if f == 1:
		break
if f == 1:
	print('NO')
else:
	print('YES')


n = int(input())
s = []
for i in range(n):
	s.append(list(input()))
for i in range(n - 2):
	for j in range(n - 1):
		if s[i][j] == '.':
			for (x, y) in ((0, 0), (-1, 1), (0, 1), (1, 1), (0, 2)):
				if s[i + y][j + x] == '.':
					s[i + y][j + x] = '#'
				else:
					print('NO')
					exit()
for i in range(n):
	if s[i].count('.'):
		print('NO')
		exit()
print('YES')


def main():
	n = int(input())
	board = []
	for i in range(n):
		row = list(input())
		board.append(row)
	for i in range(n - 2):
		for j in range(1, n - 1):
			if board[i][j] == '.' and board[i + 1][j] == '.' and (board[i + 2][j] == '.') and (board[i + 1][j + 1] == '.') and (board[i + 1][j - 1] == '.'):
				board[i][j] = '#'
				board[i + 1][j] = '#'
				board[i + 2][j] = '#'
				board[i + 1][j + 1] = '#'
				board[i + 1][j - 1] = '#'
	for i in range(n):
		for j in range(n):
			if board[i][j] == '.':
				print('NO')
				return
	print('YES')
main()


import sys
n = int(input())
B = [list(input()) for _ in range(n)]

def ok(x, y):
	return 0 <= x < n and 0 <= y < n

def try_add(i, j):
	if ok(i, j) and B[i][j] == '.':
		B[i][j] = '#'
		return True
	return False

def add_plus(i, j):
	if not try_add(i, j):
		return False
	if not try_add(i + 1, j):
		return False
	if not try_add(i + 2, j):
		return False
	if not try_add(i + 1, j - 1):
		return False
	if not try_add(i + 1, j + 1):
		return False
	return True
for i in range(n):
	for j in range(n):
		if B[i][j] == '.':
			if not add_plus(i, j):
				print('NO')
				sys.exit()
print('YES')


import collections
import random
import heapq
import bisect
import math
import time

class Solution2:

	def solve(self, A1, A2):
		pass

class Solution:

	def solve(self, grid):
		A = [[0 if c == '.' else 1 for c in row] for row in grid]

		def fill(i, j):
			if 0 < i < len(A) - 1 and 0 < j < len(A[0]) - 1:
				if A[i - 1][j] == A[i][j] == A[i + 1][j] == A[i][j + 1] == A[i][j - 1] == 0:
					A[i - 1][j] = A[i][j] = A[i + 1][j] = A[i][j + 1] = A[i][j - 1] = 1
				else:
					return False
			return True
		offset = 0
		while offset < min(len(grid) // 2, len(grid[0]) // 2):
			for i in range(len(A)):
				if A[i][offset] == 0:
					if not fill(i, offset + 1):
						return False
				if A[i][len(A[0]) - offset - 1] == 0:
					if not fill(i, len(A[0]) - offset - 2):
						return False
			for j in range(len(A[0])):
				if A[offset][j] == 0:
					if not fill(offset + 1, j):
						return False
				if A[len(A) - 1 - offset][j] == 0:
					if not fill(len(A) - 2 - offset, j):
						return False
			offset += 1
		return all((all((r == 1 for r in row)) for row in A))
sol = Solution()
sol2 = Solution2()
for test_case in range(1):
	N = input()
	a = []
	for _ in range(int(N)):
		a.append(input())
	out = sol.solve(a)
	print('YES' if out else 'NO')


vectors = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]
N = int(input())
board = [list(input()) for row_id in range(N)]
for row in range(N - 2):
	for col in range(1, N - 1):
		can_place = all((board[row + dr][col + dc] == '.' for (dr, dc) in vectors))
		if can_place:
			for (dr, dc) in vectors:
				board[row + dr][col + dc] = '#'
has_dots = any((row.count('.') for row in board))
print('NO' if has_dots else 'YES')


n = int(input())
m = []
for i in range(n):
	a = list(input())
	m.append(a)
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			if i + 2 < n and 0 < j and (j + 1 < n):
				if m[i + 1][j - 1] == m[i + 1][j] == m[i + 1][j + 1] == m[i + 2][j] == '.':
					m[i][j] = m[i + 1][j - 1] = m[i + 1][j] = m[i + 1][j + 1] = m[i + 2][j] = '#'
					continue
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			print('NO')
			exit(0)
print('YES')


n = int(input())
a = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	s = input()
	for j in range(n):
		a[i][j] = s[j]
for i in range(n):
	for j in range(n):
		if i - 1 >= 0 and i + 1 < n and (j - 1 >= 0) and (j + 1 < n):
			if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i + 1][j] == '.') and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
				a[i][j] = '#'
				a[i - 1][j] = '#'
				a[i + 1][j] = '#'
				a[i][j - 1] = '#'
				a[i][j + 1] = '#'
		else:
			pass
flag = ''
for i in range(n):
	if '.' in a[i]:
		print('NO')
		flag = 'no'
		break
if flag == '':
	print('YES')


def tile(L):
	n = len(L)
	for i in range(0, n):
		for j in range(0, n):
			if L[i][j] == '.':
				return 'NO'
	return 'YES'
n = int(input())
L = []
for i in range(0, n):
	M = list(input())
	L.append(M)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if L[i][j] == L[i - 1][j] == L[i + 1][j] == L[i][j - 1] == L[i][j + 1] == '.':
			L[i][j] = '#'
			L[i - 1][j] = '#'
			L[i + 1][j] = '#'
			L[i][j - 1] = '#'
			L[i][j + 1] = '#'
print(tile(L))


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def fill_tile(r, c):
	global b
	b[r][c] = '#'
	if r + 2 >= n or c + 1 >= n or c - 1 < 0:
		return 0
	if b[r + 1][c] == '#' or b[r + 2][c] == '#' or b[r + 1][c - 1] == '#' or (b[r + 1][c + 1] == '#'):
		return 0
	b[r + 1][c] = '#'
	b[r + 2][c] = '#'
	b[r + 1][c - 1] = '#'
	b[r + 1][c + 1] = '#'
	return 1
n = int(input())
b = []
for i in range(n):
	b.append(list(input()))
for r in range(n):
	for c in range(n):
		if b[r][c] == '.':
			if fill_tile(r, c) == 0:
				print('NO')
				exit()
print('YES')


n = int(input())
l = []
for i in range(n):
	l.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == '.':
			if l[i][j - 1] == '.' and l[i][j + 1] == '.' and (l[i - 1][j] == '.') and (l[i + 1][j] == '.'):
				l[i][j] = '#'
				l[i - 1][j] = '#'
				l[i + 1][j] = '#'
				l[i][j + 1] = '#'
				l[i][j - 1] = '#'
f = 0
for i in range(n):
	if '.' in l[i]:
		f = 1
		break
if f == 0:
	print('YES')
else:
	print('NO')


n = int(input())
S = []
for i in range(n):
	s = input()
	s = list(s)
	S.append(s)
flag = True
for i in range(n - 2):
	for j in range(n - 1):
		if S[i][j] == '.':
			if S[i + 1][j] == '.' and S[i + 1][j - 1] == '.' and (S[i + 1][j + 1] == '.') and (S[i + 2][j] == '.'):
				S[i + 1][j - 1] = '#'
				S[i + 2][j] = '#'
				S[i][j] = '#'
				S[i + 1][j] = '#'
				S[i + 1][j + 1] = '#'
			else:
				flag = False
				break
for i in range(n):
	for j in range(n):
		if S[i][j] == '.':
			flag = False
			break
if not flag:
	print('NO')
else:
	print('YES')


n = int(input())
k = [[0] * (n + 2)]
for i in range(n):
	k.append([0] + list(input()) + [0])
k.append([0] * (n + 2))
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if k[i][j] == '.' and k[i + 1][j] == '.' and (k[i - 1][j] == '.') and (k[i][j - 1] == '.') and (k[i][j + 1] == '.'):
			k[i][j] = '#'
			k[i - 1][j] = '#'
			k[i + 1][j] = '#'
			k[i][j - 1] = '#'
			k[i][j + 1] = '#'
m = True
for i in range(1, n + 1):
	if '.' in k[i]:
		print('NO')
		m = False
		break
if m:
	print('YES')


n = int(input())
MAP = [list(input().strip()) for _ in range(n)]
cnt = sum([M.count('.') for M in MAP])
d = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if MAP[i][j] == '.':
			for (dx, dy) in d:
				if MAP[i + dx][j + dy] == '#':
					break
			else:
				MAP[i][j] = '#'
				for (dx, dy) in d:
					MAP[i + dx][j + dy] = '#'
				cnt -= 5
print('NO' if cnt else 'YES')


n = int(input())
A = []
for i in range(n):
	s = input()
	A.append('#' + s + '#')
A.append('#' * (n + 2))
A.append('#' * (n + 2))
for i in range(n):
	for j in range(1, n + 1):
		if A[i][j] == '.':
			A[i] = A[i][:j] + '#' + A[i][j + 1:]
			if A[i + 1][j - 1] == A[i + 1][j] == A[i + 1][j + 1] == A[i + 2][j] == '.':
				A[i + 1] = A[i + 1][:j - 1] + '#' + A[i + 1][j:]
				A[i + 1] = A[i + 1][:j] + '#' + A[i + 1][j + 1:]
				A[i + 1] = A[i + 1][:j + 1] + '#' + A[i + 1][j + 2:]
				A[i + 2] = A[i + 2][:j] + '#' + A[i + 2][j + 1:]
			else:
				print('NO')
				exit()
print('YES')


n = int(input())
desk = []
count = 0

class Cross:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __call__(self, l):
		if (self.x > 0 and self.y > 0 and (self.x < len(l) - 1) and (self.y < len(l[0]) - 1)) and (l[self.y][self.x] == '.' and l[self.y + 1][self.x] == '.' and (l[self.y - 1][self.x] == '.') and (l[self.y][self.x + 1] == '.') and (l[self.y][self.x - 1] == '.')):
			return True
		return False

	def lay(self, l):
		l[self.y - 1] = l[self.y - 1][:self.x] + '#' + l[self.y - 1][self.x + 1:]
		l[self.y] = l[self.y][:self.x - 1] + '###' + l[self.y][self.x + 2:]
		l[self.y + 1] = l[self.y + 1][:self.x] + '#' + l[self.y + 1][self.x + 1:]
for _ in range(n):
	desk.append(input())
dots = sum([desk[i].count('.') for i in range(n)])
if dots % 5 != 0:
	print('NO')
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			cr = Cross(i, j)
			if cr(desk):
				count += 1
				cr.lay(desk)
	if count * 5 == dots:
		print('YES')
	else:
		print('NO')


n = int(input())
can = True
a = [0] * n
for i in range(n):
	s = input()
	a[i] = []
	a[i] += s
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if i < n - 2 and 0 < j < n - 1:
				if a[i + 1][j] == '.' and a[i + 2][j] == '.' and (a[i + 1][j - 1] == '.') and (a[i + 1][j + 1] == '.'):
					a[i + 1][j] = '!'
					a[i + 2][j] = '!'
					a[i + 1][j - 1] = '!'
					a[i + 1][j + 1] = '!'
				else:
					can = False
			else:
				can = False
if can:
	print('YES')
else:
	print('NO')


n = int(input())
mat = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
	c = str(input())
	for j in range(n):
		if c[j] == '#':
			mat[i][j] = 1
t = True
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if mat[i][j] == 0 and mat[i][j - 1] == 0 and (mat[i - 1][j] == 0) and (mat[i + 1][j] == 0) and (mat[i][j + 1] == 0):
			mat[i][j] = 1
			mat[i][j - 1] = 1
			mat[i - 1][j] = 1
			mat[i + 1][j] = 1
			mat[i][j + 1] = 1
for i in range(n):
	for j in range(n):
		if mat[i][j] == 0:
			t = False
if t:
	print('YES')
else:
	print('NO')


n = int(input())
a = [list(input()) for _ in range(n)]
for q in range(n):
	for q1 in range(n):
		if a[q][q1] == '.':
			if q + 2 < n and 0 < q1 and (q1 + 1 < n):
				if a[q + 1][q1 - 1] == a[q + 1][q1] == a[q + 1][q1 + 1] == a[q + 2][q1] == '.':
					a[q][q1] = a[q + 1][q1 - 1] = a[q + 1][q1] = a[q + 1][q1 + 1] = a[q + 2][q1] = '#'
					continue
			print('NO')
			return
print('YES')


n = int(input())
board = []
for i in range(n):
	board.append(list(input()))
flag = 1
for i in range(n):
	for j in range(n):
		if board[i][j] == '.':
			if i + 2 > n - 1 or j <= 0 or j >= n - 1:
				flag = 0
				break
			else:
				for k in [-1, 0, 1]:
					if board[i + 1][j + k] == '.':
						board[i + 1][j + k] = '#'
					else:
						flag = 0
				if board[i + 2][j] == '.':
					board[i + 2][j] = '#'
				else:
					flag = 0
		if flag == 0:
			break
	if flag == 0:
		break
if flag == 1:
	print('YES')
else:
	print('NO')


n = int(input())
s = []
for i in range(n):
	s.append(input())
res = True
a = [[] for i in range(n)]
for i in range(n):
	for j in range(n):
		a[i].append(s[i][j])
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			try:
				a[i + 1][j - 1]
				a[i + 1][j + 1]
				a[i + 2]
			except:
				res = False
				break
			if a[i + 1][j - 1] != '.':
				res = False
				break
			elif a[i + 1][j] != '.':
				res = False
				break
			elif a[i + 1][j + 1] != '.':
				res = False
				break
			elif a[i + 2][j] != '.':
				res = False
				break
			else:
				a[i + 1][j - 1] = '#'
				a[i + 1][j] = '#'
				a[i + 1][j + 1] = '#'
				a[i + 2][j] = '#'
if res:
	print('YES')
else:
	print('NO')


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))

def check():
	if matrix[0][0] == '.' or matrix[0][n - 1] == '.' or matrix[n - 1][0] == '.' or (matrix[n - 1][n - 1] == '.'):
		return 'NO'
	else:
		for i in range(n):
			for j in range(n):
				if matrix[i][j] == '.' and i < n - 2 and (j < n - 1):
					matrix[i][j] = '#'
					if matrix[i + 1][j - 1] == '.':
						matrix[i + 1][j - 1] = '#'
					else:
						return 'NO'
					if matrix[i + 1][j] == '.':
						matrix[i + 1][j] = '#'
					else:
						return 'NO'
					if matrix[i + 1][j + 1] == '.':
						matrix[i + 1][j + 1] = '#'
					else:
						return 'NO'
					if matrix[i + 2][j] == '.':
						matrix[i + 2][j] = '#'
					else:
						return 'NO'
		return 'YES'
c = check()
if c == 'NO':
	print(c)
elif '.' in matrix[n - 1] or '.' in matrix[n - 2]:
	print('NO')
else:
	print('YES')


def check(c, n):
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if c[i][j] == '.' and c[i - 1][j] == '.' and (c[i + 1][j] == '.') and (c[i][j - 1] == '.') and (c[i][j + 1] == '.'):
				c[i][j] = '#'
				c[i - 1][j] = '#'
				c[i + 1][j] = '#'
				c[i][j - 1] = '#'
				c[i][j + 1] = '#'
	return c

def valid(c):
	for i in range(len(c)):
		if c[i].count('#') != len(c[i]):
			return 'NO'
	return 'YES'
n = int(input())
c = []
for i in range(n):
	c.append(list(input()))
print(valid(check(c, n)))


n = int(input())
t = []
for i in range(n):
	s = list(input())
	t.append(s)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if t[i][j] == '.' and t[i - 1][j] == '.' and (t[i][j - 1] == '.') and (t[i + 1][j] == '.') and (t[i][j + 1] == '.'):
			t[i][j] = '#'
			t[i][j + 1] = '#'
			t[i][j - 1] = '#'
			t[i + 1][j] = '#'
			t[i - 1][j] = '#'
y = [['#' for i in range(n)] for j in range(n)]
if y == t:
	print('YES')
else:
	print('NO')


n = int(input())
data = []
for i in range(n):
	data.append([c for c in input()])

def do():
	for x in range(n):
		for y in range(n):
			if data[x][y] == '.':
				if x < 1 or x >= n - 1:
					continue
				if y > n - 3:
					continue
				if data[x - 1][y + 1] != '.':
					continue
				if data[x][y + 1] != '.':
					continue
				if data[x + 1][y + 1] != '.':
					continue
				if data[x][y + 2] != '.':
					continue
				data[x][y] = '#'
				data[x - 1][y + 1] = '#'
				data[x][y + 1] = '#'
				data[x + 1][y + 1] = '#'
				data[x][y + 2] = '#'
				return True
	return False
while do():
	pass
s = set()
for x in range(n):
	for y in range(n):
		s.add(data[x][y])
if len(s) == 1:
	print('YES')
else:
	print('NO')


n = int(input())
a = []
fin = []
for i in range(n):
	b = input()
	v = [0] * len(b)
	a.append(b)
	fin.append(v)
for i in range(n):
	for j in range(n):
		if a[i][j] == '#':
			fin[i][j] = 1
for i in range(1, n - 1):
	for j in range(1, len(a[i]) - 1):
		if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i][j + 1] == '.') and (a[i][j - 1] == '.') and (a[i + 1][j] == '.') and (fin[i][j] == 0) and (fin[i - 1][j] == 0) and (fin[i][j + 1] == 0) and (fin[i][j - 1] == 0) and (fin[i + 1][j] == 0):
			fin[i][j] = fin[i - 1][j] = fin[i][j + 1] = fin[i][j - 1] = fin[i + 1][j] = 1
poss = 0
for i in range(n):
	for j in range(n):
		if fin[i][j] == 0:
			poss = 1
			break
if poss:
	print('NO')
else:
	print('YES')


n = int(input())
l = []
for i in range(n):
	l.append(list(str(input())))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == '.':
			if [l[i - 1][j], l[i][j - 1], l[i + 1][j], l[i][j + 1]] == ['.', '.', '.', '.']:
				l[i - 1][j] = '#'
				l[i + 1][j] = '#'
				l[i][j] = '#'
				l[i][j + 1] = '#'
				l[i][j - 1] = '#'
for i in range(n):
	if l[i].count('.') != 0:
		print('NO')
		exit()
print('YES')


n = int(input())
board = []
for i in range(n):
	row = input()
	line = []
	for c in row:
		line.append(c)
	board.append(line)

def check_is_full(board, n):
	for i in range(n):
		for j in range(n):
			if board[i][j] == '.':
				return False
	return True

def check_position(i, j, n, board):
	if i >= 0 and j >= 0 and (j < n) and (i < n) and (board[i][j] == '.'):
		return True
	return False
for i in range(n):
	for j in range(n):
		if check_position(i - 1, j, n, board) and check_position(i, j + 1, n, board) and check_position(i + 1, j, n, board) and check_position(i, j - 1, n, board) and (board[i][j] == '.'):
			board[i][j] = '#'
			board[i - 1][j] = '#'
			board[i][j + 1] = '#'
			board[i + 1][j] = '#'
			board[i][j - 1] = '#'
if check_is_full(board, n):
	print('YES')
else:
	print('NO')


n = int(input())
T = [[] for i in range(n)]
for i in range(n):
	T[i] = list(input())
for i in range(n - 2):
	for j in range(1, n - 1):
		if T[i][j] == '.':
			T[i][j] = '#'
			for k in [-1, 0, 1]:
				if T[i + 1][j + k] == '#':
					print('NO')
					exit()
				else:
					T[i + 1][j + k] = '#'
			if T[i + 2][j] == '#':
				print('NO')
				exit()
			else:
				T[i + 2][j] = '#'
for i in range(n):
	if '.' in T[i]:
		print('NO')
		exit()
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.':
			if a[i + 1][j] == '.' and a[i - 1][j] == '.' and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
				a[i][j] = '#'
				a[i + 1][j] = '#'
				a[i - 1][j] = '#'
				a[i][j + 1] = '#'
				a[i][j - 1] = '#'
flag = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			print('NO')
			flag = 1
			break
	if flag == 1:
		break
else:
	print('YES')


__author__ = 'Esfandiar'
n = int(input())
res = list()
for i in range(n):
	res.append(list(input()))
for i in range(n):
	for j in range(n):
		if res[i][j] == '.':
			res[i][j] == '#'
			if i + 1 != n and j != 0 and (res[i + 1][j - 1] != '#'):
				res[i + 1][j - 1] = '#'
			else:
				print('NO')
				exit()
			if i + 1 != n and res[i + 1][j] != '#':
				res[i + 1][j] = '#'
			else:
				print('NO')
				exit()
			if i + 1 != n and j + 1 != n and (res[i + 1][j + 1] != '#'):
				res[i + 1][j + 1] = '#'
			else:
				print('NO')
				exit()
			if i + 2 < n and res[i + 2][j] != '#':
				res[i + 2][j] = '#'
			else:
				print('NO')
				exit()
print('YES')


n = int(input())
x = []
for i in range(n):
	x.append([s for s in input()])
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if x[i][j] == '.':
			if x[i + 1][j] == '.' and x[i - 1][j] == '.' and (x[i][j + 1] == '.') and (x[i][j - 1] == '.'):
				x[i + 1][j] = x[i - 1][j] = x[i][j + 1] = x[i][j - 1] = x[i][j] = '#'
check = True
for i in range(n):
	for j in range(n):
		if x[i][j] == '.':
			print('NO')
			check = False
			break
	if not check:
		break
if check:
	print('YES')


n = int(input())
y = []
for i in range(n):
	s = input()
	y1 = []
	for i in s:
		y1.append(i)
	y.append(y1)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if y[i][j] == '.':
			if y[i - 1][j] == '.' and y[i][j - 1] == '.' and (y[i + 1][j] == '.') and (y[i][j + 1] == '.'):
				y[i - 1][j] = '#'
				y[i][j] = '#'
				y[i + 1][j] = '#'
				y[i][j - 1] = '#'
				y[i][j + 1] = '#'
f = 0
for i in range(n):
	for j in range(n):
		if y[i][j] == '.':
			f = 1
			break
	if f == 1:
		break
if f == 1:
	print('NO')
else:
	print('YES')


import sys

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def __next__(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = self.next_line()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_line(self, _map=str):
		return list(map(_map, sys.stdin.readline().split()))

	def next_int(self):
		return int(next(self))

	def solve(self):
		n = self.next_int()
		ss = [[s for s in next(self)] for _ in range(0, n)]
		for i in range(0, n):
			for j in range(0, n):
				if ss[i][j] == '.':
					if j == 0 or j == n - 1 or i >= n - 2:
						print('NO')
						return
					if ss[i + 1][j - 1] != '.' or ss[i + 1][j] != '.' or ss[i + 1][j + 1] != '.' or (ss[i + 2][j] != '.'):
						print('NO')
						return
					ss[i + 1][j - 1] = '#'
					ss[i + 1][j] = '#'
					ss[i + 1][j + 1] = '#'
					ss[i + 2][j] = '#'
		print('YES')

def __starting_point():
	Main().solve()
__starting_point()


A = []
n = int(input())
for i in range(n):
	A.append(list(input()))
for i in range(n):
	for j in range(n):
		try:
			if A[i][j] == '.':
				A[i][j] = '#'
				if A[i + 1][j] == '.':
					A[i + 1][j] = '#'
				else:
					print('NO')
					quit()
				if A[i + 2][j] == '.':
					A[i + 2][j] = '#'
				else:
					print('NO')
					quit()
				if A[i + 1][j - 1] == '.':
					A[i + 1][j - 1] = '#'
				else:
					print('NO')
					quit()
				if A[i + 1][j + 1] == '.':
					A[i + 1][j + 1] = '#'
				else:
					print('NO')
					quit()
		except IndexError:
			print('NO')
			quit()
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append(list(map(str, input())))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == a[i - 1][j] == a[i + 1][j] == a[i][j + 1] == a[i][j - 1] == '.':
			(a[i][j], a[i - 1][j], a[i + 1][j], a[i][j + 1], a[i][j - 1]) = ['#'] * 5
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			print('NO')
			exit()
print('YES')


n = int(input())
s = []
for i in range(n):
	s.append(list(input()))

def nei(i, j):
	return [(i, j), (i + 1, j), (i + 2, j), (i + 1, j - 1), (i + 1, j + 1)]

def check(i, j):
	if i < 0 or i >= n or j < 0 or (j >= n) or (s[i][j] != '.'):
		return False
	s[i][j] = '#'
	return True
for i in range(n):
	for j in range(n):
		if s[i][j] == '#':
			continue
		for t in nei(i, j):
			if not check(t[0], t[1]):
				print('NO')
				quit()
print('YES')


n = int(input())
f = [['#'] * (n + 2)]
a = f + [[*'#' + input() + '#'] for _ in range(n)] + f * 2
d = ((1, -1), (1, 0), (1, 1), (2, 0))
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if a[i][j] == '.':
			for (k, l) in d:
				if a[i + k][j + l] < '.':
					print('NO')
					exit()
				a[i + k][j + l] = '#'
print('YES')


def check(s):
	for i in range(1, len(s) - 1):
		for j in range(1, len(s[i]) - 1):
			if s[i - 1][j] == '.':
				if s[i][j] == '#':
					return False
				if s[i][j - 1] == '#':
					return False
				if s[i][j + 1] == '#':
					return False
				if s[i + 1][j] == '#':
					return False
				s[i - 1] = s[i - 1][:j] + '#' + s[i - 1][j + 1:]
				s[i] = s[i][:j - 1] + '###' + s[i][j + 2:]
				s[i + 1] = s[i + 1][:j] + '#' + s[i + 1][j + 1:]
	if s[-1].count('.') > 0:
		return False
	return True
n = int(input())
s = [input() for i in range(n)]
cnt = 0
for i in s:
	cnt += i.count('.')
if cnt % 5 != 0:
	print('NO')
elif check(s):
	print('YES')
else:
	print('NO')


board = []

def check(i, j):
	if i < N and j < N and (board[i][j] == '.'):
		board[i][j] = '#'
		return True
	return False
N = int(input())
flag = True
for i in range(N):
	temp = []
	row = input()
	for x in row:
		temp.append(x)
	board.append(temp)
for i in range(N):
	for j in range(N):
		if board[i][j] == '.':
			if not check(i + 1, j - 1) or not check(i + 1, j) or (not check(i + 1, j + 1)) or (not check(i + 2, j)):
				flag = False
				break
	if not flag:
		break
print('YES' if flag else 'NO')


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
n = int(input())
l = []
for i in range(n):
	s = list(input().strip())
	l.append(s)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == '.':
			if l[i + 1][j] == '.' and l[i - 1][j] == '.' and (l[i][j + 1] == '.') and (l[i][j - 1] == '.'):
				l[i + 1][j] = '#'
				l[i - 1][j] = '#'
				l[i][j + 1] = '#'
				l[i][j - 1] = '#'
				l[i][j] = '#'
for i in range(n):
	for j in range(n):
		if l[i][j] == '.':
			print('NO')
			exit()
print('YES')


import sys
input = sys.stdin.readline
n = int(input().rstrip())
data = []
for _ in range(n):
	data.append(list(input().rstrip()))
for i in range(n):
	for j in range(n):
		if data[i][j] == '.' and i - 1 >= 0 and (j - 1 >= 0) and (i + 1 <= n - 1) and (j + 1 <= n - 1):
			if data[i - 1][j] == '.' and data[i + 1][j] == '.' and (data[i][j - 1] == '.') and (data[i][j + 1] == '.'):
				data[i - 1][j] = '#'
				data[i + 1][j] = '#'
				data[i][j] = '#'
				data[i][j + 1] = '#'
				data[i][j - 1] = '#'
for line in data:
	for ch in line:
		if ch == '.':
			print('NO')
			exit(0)
print('YES')


def mp():
	return map(int, input().split())
n = int(input())
a = [[j for j in input()] for i in range(n)]
fail = False
for i in range(n):
	for j in range(n):
		if a[i][j] == '#':
			continue
		if (i + 1 < n and a[i + 1][j] == '.') and (i + 2 < n and a[i + 2][j] == '.') and (i + 1 < n and j + 1 < n and (a[i + 1][j + 1] == '.')) and (i + 1 < n and j - 1 >= 0 and (a[i + 1][j - 1] == '.')):
			a[i][j] = '#'
			a[i + 1][j] = '#'
			a[i + 2][j] = '#'
			a[i + 1][j + 1] = '#'
			a[i + 1][j - 1] = '#'
		else:
			fail = True
	if fail:
		break
for i in a:
	for j in i:
		if j != '#':
			fail = True
			break
if fail:
	print('NO')
else:
	print('YES')


n = int(input())
li = []
for i in range(n):
	li.append(list(input()))
(i, j) = (0, 1)
while i <= n - 3:
	if li[i][j] == '.':
		if li[i + 1][j - 1] == '.' and li[i + 1][j] == '.' and (li[i + 1][j + 1] == '.'):
			if li[i + 2][j] == '.':
				li[i][j] = '#'
				li[i + 1][j - 1] = '#'
				li[i + 1][j] = '#'
				li[i + 1][j + 1] = '#'
				li[i + 2][j] = '#'
	j += 1
	if j >= n - 1:
		i += 1
		j = 0
f = True
for i in range(n):
	for j in range(n):
		if li[i][j] == '.':
			f = False
			break
if f:
	print('YES')
else:
	print('NO')


gi = lambda : list(map(int, input().strip().split()))
(n,) = gi()
m = [list(input()) for e in range(n)]
for k in range(1, n - 1):
	for j in range(1, n - 1):
		if m[k - 1][j] == m[k + 1][j] == m[k][j - 1] == m[k][j + 1] == m[k][j] == '.':
			m[k - 1][j] = m[k + 1][j] = m[k][j - 1] = m[k][j + 1] = m[k][j] = '#'
for k in range(n):
	for j in range(n):
		if m[k][j] == '.':
			print('NO')
			return
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
ans = True
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if i < n - 2 and j > 0 and (j < n - 1) and (a[i + 1][j] == '.') and (a[i + 2][j] == '.') and (a[i + 1][j - 1] == '.') and (a[i + 1][j + 1] == '.'):
				a[i][j] = '#'
				a[i + 1][j] = '#'
				a[i + 2][j] = '#'
				a[i + 1][j - 1] = '#'
				a[i + 1][j + 1] = '#'
			else:
				ans = False
if ans:
	print('YES')
else:
	print('NO')


n = int(input())
d = []

def check(a, n):
	for i in range(n):
		for (j, c) in enumerate(a[i]):
			if c == '.':
				if j < 1 or j > n - 2:
					return False
				if i > n - 3:
					return False
				if a[i + 1][j - 1] == a[i + 1][j] == a[i + 1][j + 1] == a[i + 2][j] == '.':
					a[i + 1][j - 1] = '#'
					a[i + 1][j] = '#'
					a[i + 1][j + 1] = '#'
					a[i + 2][j] = '#'
				else:
					return False
	return True
for i in range(n):
	d.append([c for c in input()])
print('YES' if check(d, n) else 'NO')


import sys

def get_single_int():
	return int(sys.stdin.readline().strip())

def get_string():
	return sys.stdin.readline().strip()

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def change():
	if ar[i + 1][j] == '.' and ar[i - 1][j] == '.':
		if ar[i][j + 1] == '.' and ar[i][j - 1] == '.':
			ar[i + 1][j] = '#'
			ar[i - 1][j] = '#'
			ar[i][j + 1] = '#'
			ar[i][j - 1] = '#'
			ar[i][j] = '#'
n = get_single_int()
ar = []
for i in range(n):
	ar.append(list(get_string()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if ar[i][j] != '#':
			change()
ans = 'YES'
for i in ar:
	if '.' in i:
		ans = 'NO'
		break
print(ans)


n = int(input())
Matrix = []
for _ in range(n):
	temp = [i for i in input()]
	Matrix.append(temp)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if Matrix[i][j] == '.' and Matrix[i][j - 1] == '.' and (Matrix[i][j + 1] == '.') and (Matrix[i - 1][j] == '.') and (Matrix[i + 1][j] == '.'):
			Matrix[i][j - 1] = '#'
			Matrix[i][j + 1] = '#'
			Matrix[i + 1][j] = '#'
			Matrix[i - 1][j] = '#'
			Matrix[i][j] = '#'
fla = 0
for i in range(n):
	for j in range(n):
		if Matrix[i][j] == '.':
			fla = 1
			break
	if fla:
		break
if fla:
	print('NO')
else:
	print('YES')


import sys
from itertools import accumulate
input = sys.stdin.readline

def ii():
	return int(input())

def mi():
	return map(int, input().rstrip().split())

def lmi():
	return list(map(int, input().rstrip().split()))

def li():
	return list(input().rstrip())
N = ii()
a = [['.' for __ in range(N)] for _ in range(N)]
for i in range(N):
	a[i] = li()
	a[i].insert(0, '#')
	a[i].append('#')
a.insert(0, ['#'] * (N + 2))
a.append(['#'] * (N + 2))
dx = [-1, 0, 1, 0, 0]
dy = [0, -1, 0, 1, 0]

def check(i, j, a):
	if 2 <= i <= N - 1 and 2 <= j <= N - 1:
		tmp = []
		for num in range(5):
			tmp.append(a[i + dx[num]][j + dy[num]] == '.')
		return all(tmp)
	else:
		return False
for i in range(2, N):
	for j in range(2, N):
		if check(i, j, a):
			for num in range(5):
				a[i + dx[num]][j + dy[num]] = '#'
if a == [['#'] * (N + 2)] * (N + 2):
	print('YES')
else:
	print('NO')


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, OrderedDict
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
n = intIn()
mtx = []
cntd = 0
for i in range(n):
	s = stringIn()
	cntd += s.count('.')
	mtx.append(list(s))
cnt = 0
if cntd % 5 == 0:
	for i in range(n - 2):
		for j in range(1, n - 1):
			if mtx[i][j] == '.':
				if mtx[i][j] == mtx[i + 1][j - 1] == mtx[i + 1][j] == mtx[i + 1][j + 1] == mtx[i + 2][j]:
					mtx[i][j] = '#'
					mtx[i + 1][j - 1] = '#'
					(mtx[i + 1][j], mtx[i + 1][j + 1], mtx[i + 2][j]) = ('#', '#', '#')
					cnt += 5
	if cntd - cnt == 0:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


import sys
import copy
sys.setrecursionlimit(1000000)
DX = [0, 1, 0, -1]
DY = [1, 0, -1, 0]
n = int(input())
S = [input() for _ in range(n)]
for i in range(n):
	for j in range(n):
		if i == 0 or i == n - 1 or j == 0 or (j == n - 1) or (S[i][j] == '#'):
			continue
		cnt = 0
		for k in range(4):
			y = i + DY[k]
			x = j + DX[k]
			cnt += S[y][x] == '.'
		if cnt == 4:
			S[i] = S[i][:j] + '#' + S[i][j + 1:]
			for k in range(4):
				y = i + DY[k]
				x = j + DX[k]
				S[y] = S[y][:x] + '#' + S[y][x + 1:]
good = True
for i in range(n):
	for j in range(n):
		if S[i][j] == '.':
			good = False
print(['NO', 'YES'][good])


def can_be_filled(board: list):
	for row in board:
		if row.count('.') > 0:
			return True
	return False

def main():
	n = int(input())
	board = [list(input()) for row in range(n)]
	for row in range(1, n - 1):
		for col in range(1, n - 1):
			if board[row][col] != '#':
				if board[row - 1][col] == '.' and board[row + 1][col] == '.' and (board[row][col - 1] == '.') and (board[row][col + 1] == '.'):
					board[row - 1][col] = '#'
					board[row + 1][col] = '#'
					board[row][col - 1] = '#'
					board[row][col + 1] = '#'
					board[row][col] = '#'
	if can_be_filled(board):
		print('NO')
	else:
		print('YES')
main()


def torture(n, board):
	vectors = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]
	for row in range(n - 2):
		for col in range(1, n - 1):
			flag = all((board[row + x][col + y] == '.' for (x, y) in vectors))
			if flag:
				for (x, y) in vectors:
					board[row + x][col + y] = '#'
	dots = any((row.count('.') for row in board))
	if dots:
		return 'NO'
	return 'YES'
N = int(input())
lst = [list(input()) for row_id in range(N)]
print(torture(N, lst))


n = int(input())
tab = []
for i in range(n):
	a = list(input())
	tab.append(a)
for i in range(i):
	for j in range(n):
		if 0 < i < n - 1 and 0 < j < n - 1 and (tab[i - 1][j] == tab[i + 1][j] == tab[i][j + 1] == tab[i][j - 1] == tab[i][j] == '.'):
			tab[i][j] = '#'
			tab[i - 1][j] = '#'
			tab[i + 1][j] = '#'
			tab[i][j - 1] = '#'
			tab[i][j + 1] = '#'
for i in range(n):
	for j in range(n):
		if tab[i][j] == '.':
			print('NO')
			return
print('YES')


import sys
import math

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def printspx(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')

def printchk(*args):
	return print(*args, end=' \\ ')
MODPRIME = int(1000000000.0 + 7)
BABYMODPR = 998244353
n = int(input())
matr = []
for i in range(n):
	li = list(input())
	matr.append(li)
flag = True
for i in range(n):
	for j in range(n):
		try:
			if matr[i][j] == '.':
				if matr[i + 1][j] == matr[i + 1][j + 1] == matr[i + 1][j - 1] == matr[i + 2][j] == '.':
					matr[i + 1][j] = matr[i + 1][j + 1] = matr[i + 1][j - 1] = matr[i + 2][j] = '#'
				else:
					flag = False
					break
		except:
			flag = False
			break
if flag:
	print('YES')
else:
	print('NO')


n = int(input())
m = [list(input()) for i in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if m[i][j] + m[i][j - 1] + m[i - 1][j] + m[i][j + 1] + m[i + 1][j] == '.' * 5:
			(m[i][j], m[i][j - 1], m[i - 1][j], m[i][j + 1], m[i + 1][j]) = ('#', '#', '#', '#', '#')
if m == [['#' for j in range(n)] for i in range(n)]:
	print('YES')
else:
	print('NO')


n = int(input())
table = []
for i in range(n):
	table.append(list(input()))
for i in range(1, n - 1):
	for j in range(0, n - 2):
		if table[i][j] == '.':
			if table[i + 1][j + 1] == '.' and table[i - 1][j + 1] == '.' and (table[i][j + 1] == '.') and (table[i][j + 2] == '.'):
				table[i + 1][j + 1] = '#'
				table[i][j + 1] = '#'
				table[i - 1][j + 1] = '#'
				table[i][j] = '#'
				table[i][j + 2] = '#'
status = -1
for i in range(n):
	if '.' in table[i]:
		status = 1
if status == 1:
	print('NO')
else:
	print('YES')


n = int(input())
s = []
isContinue = True
res = 'YES'
for i in range(n):
	temp = input()
	s.append([1 if temp[_] == '#' else 0 for _ in range(n)])
for i in range(n):
	if res == 'NO':
		break
	elif sum(s[i]) == n:
		pass
	elif n - i <= 2:
		res = 'NO'
		break
	else:
		for j in range(n):
			if s[i][j] == 0:
				if j == 0 or j == n - 1:
					res = 'NO'
					break
				elif s[i + 1][j - 1] == 0 and s[i + 1][j] == 0 and (s[i + 1][j + 1] == 0) and (s[i + 2][j] == 0):
					s[i][j] = 1
					s[i + 1][j - 1] = 1
					s[i + 1][j] = 1
					s[i + 1][j + 1] = 1
					s[i + 2][j] = 1
				else:
					res = 'NO'
					break
print(res)


import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def inar():
	return [int(k) for k in input().split()]

def main():
	n = int(input())
	matrix = []
	counter = 0
	for i in range(n):
		st = list(input())
		matrix.append(st)
	for i in range(n):
		for j in range(n):
			if matrix[i][j] == '.':
				if i + 1 < n and matrix[i + 1][j] == '.':
					if j + 1 < n and matrix[i + 1][j + 1] == '.':
						if j - 1 >= 0 and matrix[i + 1][j - 1] == '.':
							if i + 2 < n and matrix[i + 2][j] == '.':
								matrix[i][j] = '#'
								matrix[i + 1][j] = '#'
								matrix[i + 1][j + 1] = '#'
								matrix[i + 1][j - 1] = '#'
								matrix[i + 2][j] = '#'
							else:
								counter = 1
								break
						else:
							counter = 1
							break
					else:
						counter = 1
						break
				else:
					counter = 1
					break
		if counter:
			break
	if counter:
		print('NO')
	else:
		print('YES')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
a = []
for i in range(n):
	c = list(input())
	a.append(c)
for i in range(1, len(a) - 1):
	for j in range(1, len(a[i]) - 1):
		if a[i][j] == '.' and a[i + 1][j] == '.' and (a[i][j + 1] == '.') and (a[i - 1][j] == '.') and (a[i][j - 1] == '.'):
			a[i][j] = '#'
			a[i + 1][j] = '#'
			a[i][j + 1] = '#'
			a[i - 1][j] = '#'
			a[i][j - 1] = '#'
for i in range(len(a)):
	if a[i].count('.') > 0:
		print('NO')
		exit()
print('YES')


n = int(input())
a = []
for i in range(n):
	tmp = input()
	b = []
	for j in range(len(tmp)):
		b.append(tmp[j])
	a.append(b)
if a[0][0] == '.' or a[0][n - 1] == '.' or a[n - 1][0] == '.' or (a[n - 1][n - 1] == '.'):
	print('NO')
	exit()
i = 1
j = 1
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i + 1][j] == '.') and (a[i][j + 1] == '.') and (a[i][j - 1] == '.'):
			a[i - 1][j] = '#'
			a[i + 1][j] = '#'
			a[i][j + 1] = '#'
			a[i][j - 1] = '#'
			a[i][j] = '#'
i = 0
j = 0
cnt = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			cnt += 1
if cnt > 0:
	print('NO')
else:
	print('YES')


n = int(input())

def can_do(grid, i, j, n):
	if i + 2 < n:
		if j - 1 >= 0:
			if j + 1 < n:
				if grid[i][j] == '.' and grid[i + 1][j - 1] == '.':
					if grid[i + 1][j] == '.' and grid[i + 1][j + 1] == '.' and (grid[i + 2][j] == '.'):
						return True
	return False
grid = []
for _ in range(n):
	grid.append(list(input().strip()))
for i in range(len(grid)):
	for j in range(len(grid[i])):
		if grid[i][j] == '.':
			if can_do(grid, i, j, n):
				grid[i][j] = '#'
				grid[i + 1][j - 1] = '#'
				grid[i + 1][j] = '#'
				grid[i + 1][j + 1] = '#'
				grid[i + 2][j] = '#'
			else:
				print('NO')
				exit(0)
print('YES')


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if matrix[i][j - 1] == '.' and matrix[i][j] == '.' and (matrix[i][j + 1] == '.') and (matrix[i - 1][j] == '.') and (matrix[i + 1][j] == '.'):
			matrix[i][j - 1] = '#'
			matrix[i][j] = '#'
			matrix[i][j + 1] = '#'
			matrix[i - 1][j] = '#'
			matrix[i + 1][j] = '#'
for i in range(n):
	for j in range(n):
		if matrix[i][j] == '.':
			print('NO')
			exit()
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
res = True
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if j < 1 or j == n - 1 or i >= n - 2:
				print('NO')
				res = False
				break
			elif a[i + 1][j + 1] != '.' or a[i + 1][j] != '.' or a[i + 1][j - 1] != '.' or (a[i + 2][j] != '.'):
				print('NO')
				res = False
				break
			else:
				a[i + 1][j + 1] = 'x'
				a[i + 1][j] = 'x'
				a[i + 1][j - 1] = 'x'
				a[i + 2][j] = 'x'
	if not res:
		break
if res:
	print('YES')


n = int(input())
arr = [None] * n
for i in range(n):
	arr[i] = list(input())
flag = 0
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			try:
				if j >= 1 and arr[i + 1][j] == '.' and (arr[i + 2][j] == '.') and (arr[i + 1][j + 1] == '.') and (arr[i + 1][j - 1] == '.'):
					arr[i][j] = '#'
					arr[i + 1][j] = '#'
					arr[i + 2][j] = '#'
					arr[i + 1][j + 1] = '#'
					arr[i + 1][j - 1] = '#'
				else:
					flag = 1
					break
			except:
				flag = 1
				break
	if flag == 1:
		break
print('YES' if flag == 0 else 'NO')


t = []
a = int(input())
h = 0
for i in range(a):
	u = input()
	t.append(list(u))
for j in range(1, a - 1):
	for k in range(1, a - 1):
		if t[j][k] == '.':
			if t[j][k - 1] == '.' and t[j][k + 1] == '.' and (t[j + 1][k] == '.') and (t[j - 1][k] == '.'):
				t[j][k] = '#'
				t[j][k + 1] = '#'
				t[j][k - 1] = '#'
				t[j + 1][k] = '#'
				t[j - 1][k] = '#'
			else:
				pass
		else:
			pass
for y in t:
	if '.' in y:
		print('NO')
		h += 1
		break
if h == 0:
	print('YES')


n = int(input())
arr = [[x for x in input()] for _ in range(n)]
move = [(1, -1), (1, 0), (1, 1), (2, 0)]
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			arr[i][j] = '#'
			for m in move:
				(mi, mj) = (i + m[0], j + m[1])
				if 0 <= mi < n and 0 <= mj < n and (arr[mi][mj] == '.'):
					arr[mi][mj] = '#'
				else:
					print('NO')
					return
print('YES')


n = int(input())
row1 = [''] * n
row2 = [''] * n
row3 = [''] * n
s1 = input()
s2 = input()
for i in range(n):
	row1[i] = s1[i]
	row2[i] = s2[i]
for j in range(2, n):
	s = input()
	for i in range(n):
		row3[i] = s[i]
	for i in range(n):
		if row1[i] == '#':
			continue
		elif (i == 0 or i == n - 1) and row1[i] == '.':
			print('NO')
			exit(0)
		elif row2[i] == '.' and row3[i] == '.' and (row2[i - 1] == '.') and (row2[i + 1] == '.'):
			row2[i] = '#'
			row2[i - 1] = '#'
			row2[i + 1] = '#'
			row3[i] = '#'
		else:
			print('NO')
			exit(0)
	for i in range(n):
		row1[i] = row2[i]
		row2[i] = row3[i]
for i in range(n):
	if row1[i] != '#' or row2[i] != '#':
		print('NO')
		exit(0)
print('YES')


n = int(input())
s = []
for i in range(n):
	a = list(input())
	s.append(a)
count = 0
for i in range(n - 2):
	for j in range(n - 2):
		if s[i][j + 1] == s[i + 1][j] == s[i + 1][j + 1] == s[i + 1][j + 2] == s[i + 2][j + 1] == '.':
			s[i][j + 1] = '#'
			s[i + 1][j] = '#'
			s[i + 1][j + 1] = '#'
			s[i + 1][j + 2] = '#'
			s[i + 2][j + 1] = '#'
for i in range(n):
	for j in range(n):
		if s[i][j] == '.':
			count += 1
			break
	if count > 0:
		print('NO')
		break
else:
	print('YES')


def step(a, b):
	if a > n - 3 or b == 0 or b == n - 1 or (l[a + 1][b] == '#') or (l[a + 2][b] == '#') or (l[a + 1][b - 1] == '#') or (l[a + 1][b + 1] == '#'):
		return False
	else:
		l[a] = l[a][:b] + '#' + l[a][b + 1:]
		l[a + 1] = l[a + 1][:b - 1] + '###' + l[a + 1][b + 2:]
		l[a + 2] = l[a + 2][:b] + '#' + l[a + 2][b + 1:]
		return True
n = int(input())
l = [input() for i in range(n)]
ans = 'YES'
for i in range(n):
	for j in range(n):
		if l[i][j] == '.' and (not step(i, j)):
			ans = 'NO'
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys
n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
c = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			c += 1
if c % 5 != 0:
	print('NO')
	sys.exit()
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i + 1][j] == '.') and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
			a[i][j] = '#'
			a[i + 1][j] = '#'
			a[i - 1][j] = '#'
			a[i][j + 1] = '#'
			a[i][j - 1] = '#'
			c -= 5
if c == 0:
	print('YES')
else:
	print('NO')


def cros(x, y):
	global mas
	global n
	hod = [(x - 1, y + 1), (x, y + 2), (x, y + 1), (x + 1, y + 1)]
	for i in hod:
		if i[0] < 0 or i[0] >= n or i[1] < 0 or (i[1] >= n):
			return False
		if mas[i[0]][i[1]] == True:
			return False
		else:
			mas[i[0]][i[1]] = True
	return True
n = int(input())
mas = []
for i in range(n):
	mas.append([])
	s = input()
	for j in range(n):
		if s[j] == '#':
			mas[i].append(True)
		else:
			mas[i].append(False)
for y in range(n):
	for x in range(n):
		if mas[x][y] == False:
			if not cros(x, y):
				print('NO')
				exit()
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append([True if j == '#' else False for j in input()])

def checkSides(a, n):
	for i in range(1, n - 1):
		if not a[i][0] and a[i][1] or (not a[0][i] and a[1][i]) or (not a[i][n - 1] and a[i][n - 2]) or (not a[n - 1][i] and a[n - 2][i]):
			return False
	return True

def countSides(i, j, a):
	c = 0
	if not a[i][j - 1]:
		c += 1
	if not a[i - 1][j]:
		c += 1
	if not a[i][j + 1]:
		c += 1
	if not a[i + 1][j]:
		c += 1
	return c
y = True
if not a[0][0] or not a[n - 1][0] or (not a[0][n - 1]) or (not a[n - 1][n - 1]):
	y = False
elif not checkSides(a, n):
	y = False
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if not a[i][j] and countSides(i, j, a) == 4:
				a[i][j] = a[i][j - 1] = a[i - 1][j] = a[i][j + 1] = a[i + 1][j] = True
	for i in range(n):
		for j in range(n):
			if not a[i][j]:
				y = False
print('YES' if y else 'NO')


n = int(input())
a = [list(input()) for i in range(n)]
f = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			try:
				if a[i][j] == '.' and a[i + 1][j] == '.' and (a[i + 1][j - 1] == '.') and (a[i + 1][j + 1] == '.') and (a[i + 2][j] == '.'):
					(a[i][j], a[i + 1][j], a[i + 1][j - 1], a[i + 1][j + 1], a[i + 2][j]) = ('#', '#', '#', '#', '#')
				else:
					f = 1
					break
			except IndexError:
				f = 1
				break
	if f == 1:
		break
if f == 0:
	print('YES')
else:
	print('NO')


n = int(input())
a = []
for j in range(n):
	a.append(input())
l = len(a[0])
c = dict()
for i in range(n):
	for j in range(l):
		p = 0
		if a[i][j] == '.' and (i, j) not in c.keys():
			try:
				if a[i + 1][j] == '.' and a[i + 2][j] == '.' and (a[i + 1][j - 1] == '.') and (a[i + 1][j + 1] == '.') and ((i + 1, j) not in c.keys()) and ((i + 2, j) not in c.keys()) and ((i + 1, j - 1) not in c.keys()) and ((i + 1, j + 1) not in c.keys()):
					c[i, j] = 1
					c[i + 1, j] = 1
					c[i + 2, j] = 1
					c[i + 1, j - 1] = 1
					c[i + 1, j + 1] = 1
				else:
					p = 1
			except:
				p = 1
		if p == 1:
			break
	if p == 1:
		break
if p == 1:
	print('NO')
else:
	print('YES')


n = int(input())
mat = []
for _ in range(n):
	inp = input()
	lis = [i for i in inp]
	mat.append(lis)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if mat[i][j] == '.':
			if mat[i + 1][j] == '.' and mat[i - 1][j] == '.' and (mat[i][j + 1] == '.') and (mat[i][j - 1] == '.'):
				mat[i + 1][j] = '#'
				mat[i - 1][j] = '#'
				mat[i][j + 1] = '#'
				mat[i][j - 1] = '#'
				mat[i][j] = '#'
able = 1
for i in range(n):
	for j in range(n):
		if mat[i][j] == '.':
			able = 0
			break
if able == 1:
	print('YES')
else:
	print('NO')


def try_place_tile(field, r, c):
	deltas = [(-1, 0), (1, 0), (0, -1), (0, 1), (0, 0)]
	for (dx, dy) in deltas:
		if not 0 <= r + dx < len(field):
			return False
		if not 0 <= c + dy < len(field[0]):
			return False
		if not field[r + dx][c + dy] == '.':
			return False
		field[r + dx][c + dy] = '#'
	return True
n = int(input())
field = []
for _ in range(n):
	field.append(list(input()))
for row in range(n):
	for col in range(n):
		if field[row][col] == '.':
			if not try_place_tile(field, row + 1, col):
				print('NO')
				quit()
print('YES')


import sys

def checkboard(A, m, n, s):
	if m == 0 or m == s - 1 or n == 0 or (n == s - 1):
		return False
	if A[m][n] + A[m - 1][n] + A[m + 1][n] + A[m][n + 1] + A[m][n - 1] == '.....':
		return True
	return False

def update(A, m, n):
	(A[m][n], A[m + 1][n], A[m - 1][n], A[m][n - 1], A[m][n + 1]) = ('#', '#', '#', '#', '#')
	return
n = int(input())
board = [[str(i) for i in input()] for _ in range(n)]
for i in range(n):
	for j in range(n):
		if checkboard(board, i, j, n):
			update(board, i, j)
for i in board:
	for j in i:
		if j == '.':
			print('NO')
			sys.exit()
print('YES')


n = int(input())
c = []
f = 1
for i in range(n):
	c.append(list(input()))
for (i, v) in enumerate(c):
	for (j, k) in enumerate(v):
		if k == '.':
			if i + 2 >= n or j + 1 >= n or j - 1 >= n:
				f = 0
				break
			if c[i + 1][j - 1] == '.' and c[i + 1][j] == '.' and (c[i + 1][j + 1] == '.') and (c[i + 2][j] == '.'):
				c[i + 1][j - 1] = '1'
				c[i + 1][j] = '1'
				c[i + 1][j + 1] = '1'
				c[i + 2][j] = '1'
			else:
				f = 0
				break
if f == 0:
	print('NO')
else:
	print('YES')


n = int(input())
wood = []
for i in range(0, n):
	wood.append(list(input()))
for i in range(1, n - 1):
	for y in range(1, n - 1):
		if wood[i][y] == '.':
			if wood[i][y - 1] == '.' and wood[i][y + 1] == '.' and (wood[i - 1][y] == '.') and (wood[i + 1][y] == '.'):
				wood[i][y] = '#'
				wood[i - 1][y] = '#'
				wood[i + 1][y] = '#'
				wood[i][y - 1] = '#'
				wood[i][y + 1] = '#'
yr = True
for i in range(0, n):
	for y in range(0, n):
		if wood[i][y] == '.':
			yr = False
if yr:
	print('YES')
else:
	print('NO')


import math
import heapq
n = int(input())
cl = [list() for _ in range(n)]
for i in range(n):
	s = input()
	for j in range(n):
		cl[i].append(s[j])
for i in range(n):
	for j in range(n):
		if cl[i][j] == '.':
			if j == n - 1 or j == 0 or i == n - 1 or (i == n - 2):
				print('NO')
				exit()
			elif cl[i + 1][j] == '.' and cl[i + 1][j - 1] == '.' and (cl[i + 1][j + 1] == '.') and (cl[i + 2][j] == '.'):
				cl[i + 1][j] = '#'
				cl[i + 1][j - 1] = '#'
				cl[i + 1][j + 1] = '#'
				cl[i + 2][j] = '#'
			else:
				print('NO')
				exit()
print('YES')


X = [0, -1, 0, 1, 0]
Y = [0, 1, 1, 1, 2]
(n, *a) = [*open(0)]
n = int(n)
a = [list(x) for x in a]
for r in range(n - 2):
	for c in range(1, n - 1):
		if all((a[r + y][c + x] == '.' for (y, x) in zip(Y, X))):
			for (y, x) in zip(Y, X):
				a[r + y][c + x] = '#'
print('YNEOS'[any(('.' in x for x in a))::2])


def main():
	for i in range(n - 2):
		for j in range(n):
			if table[i][j] == '.':
				if 0 < j < n - 1 and '#' in {table[i + 1][j], table[i + 2][j], table[i + 1][j - 1], table[i + 1][j + 1]} or not 0 < j < n - 1:
					return False
				else:
					table[i + 1][j] = table[i + 2][j] = table[i + 1][j - 1] = table[i + 1][j + 1] = '#'
	for i in range(n - 2, n):
		for j in range(n):
			if table[i][j] == '.':
				return False
	return True
n = int(input())
table = []
for _ in range(n):
	table.append(list(input()))
print('yes' if main() else 'no')


n = int(input())
mtx = []
res = 'yes'
for i in range(n):
	mtx.append(list(input()))
for i in range(n - 2):
	for j in range(n):
		if mtx[i][j] == '.':
			if j == n - 1 or '#' in {mtx[i + 1][j - 1], mtx[i + 1][j], mtx[i + 1][j + 1], mtx[i + 2][j]}:
				res = 'no'
				break
			else:
				mtx[i][j] = mtx[i + 1][j - 1] = mtx[i + 1][j] = mtx[i + 1][j + 1] = mtx[i + 2][j] = '#'
for i in range(n - 2, n):
	for j in range(n):
		if mtx[i][j] == '.':
			res = 'no'
			break
print(res)


lengthOfSide = int(input())
matrix = []
for i in range(lengthOfSide):
	segment = list(input())
	string = []
	for j in range(lengthOfSide):
		if segment[j] == '#':
			string.append(1)
		else:
			string.append(0)
	matrix.append(string)
start = 1
end = lengthOfSide - 1
for i in range(start, end):
	for j in range(start, end):
		if matrix[i][j] == 0:
			if matrix[i - 1][j] == 0 and matrix[i + 1][j] == 0 and (matrix[i][j + 1] == 0) and (matrix[i][j - 1] == 0):
				matrix[i][j] = 1
				matrix[i - 1][j] = 1
				matrix[i + 1][j] = 1
				matrix[i][j - 1] = 1
				matrix[i][j + 1] = 1
flag = False
for i in range(lengthOfSide):
	for j in range(lengthOfSide):
		if matrix[i][j] == 0:
			flag = True
			print('NO')
			break
	if flag:
		break
	if i == lengthOfSide - 1:
		print('YES')


n = int(input())
(l, f) = ([], 0)
for _ in range(n):
	l.append(list(input()))
for x in range(1, n - 1):
	for y in range(n - 2):
		if l[x][y] == '.' and l[x][y + 1] == '.' and (l[x][y + 2] == '.') and (l[x - 1][y + 1] == '.') and (l[x + 1][y + 1] == '.'):
			l[x][y] = '#'
			l[x][y + 1] = '#'
			l[x][y + 2] = '#'
			l[x - 1][y + 1] = '#'
			l[x + 1][y + 1] = '#'
	if '.' in l[x - 1]:
		f = 1
		break
if '.' in l[-1] + l[-2]:
	f = 1
print(['YES', 'NO'][f == 1])


import math
from decimal import Decimal

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = list(map(int, input().split()))
	return (n, m)

def dva():
	(n, m) = list(map(int, input().split()))
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
n = int(input())
a = []
for i in range(n):
	s = input()
	s = list(s)
	a.append(s)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i][j + 1] == '.' and (a[i][j - 1] == '.') and (a[i - 1][j] == '.') and (a[i + 1][j] == '.'):
			(a[i][j], a[i][j + 1], a[i][j - 1], a[i - 1][j], a[i + 1][j]) = ('#', '#', '#', '#', '#')
f = True
for i in a:
	for j in i:
		if j == '.':
			f = False
if f:
	print('YES')
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == a[i + 1][j] == a[i][j + 1] == a[i - 1][j] == a[i][j - 1] == '.':
			a[i][j] = '#'
			a[i + 1][j] = '#'
			a[i][j + 1] = '#'
			a[i - 1][j] = '#'
			a[i][j - 1] = '#'
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			print('NO')
			exit(0)
print('YES')


n = int(input())
ls = []
for i in range(n):
	s = input()
	s = [s[i] for i in range(n)]
	ls.append(s)
flag = True
for i in range(n):
	for j in range(n):
		if ls[i][j] == '.':
			if i < n - 2 and 0 < j < n - 1:
				if ls[i + 1][j] == '.' and ls[i + 2][j] == '.' and (ls[i + 1][j - 1] == '.') and (ls[i + 1][j + 1] == '.'):
					ls[i][j] = '#'
					ls[i + 1][j] = '#'
					ls[i + 2][j] = '#'
					ls[i + 1][j - 1] = '#'
					ls[i + 1][j + 1] = '#'
				else:
					flag = False
					break
			else:
				flag = False
				break
if flag:
	print('YES')
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append([])
	s = input()
	for j in s:
		a[i].append(j)
k = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '#':
			k += 1
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i][j - 1] == '.') and (a[i][j + 1] == '.') and (a[i + 1][j] == '.'):
			k += 5
			a[i][j] = '#'
			a[i - 1][j] = '#'
			a[i][j - 1] = '#'
			a[i][j + 1] = '#'
			a[i + 1][j] = '#'
if k == n ** 2:
	print('YES')
else:
	print('NO')


from sys import stdin
sys_input = stdin.readline

def si():
	return sys_input().rstrip()

def ii():
	return int(si())

def sti():
	return si().split()

def iti():
	return map(int, sti())

def sli():
	return list(si())

def ili():
	return list(iti())

def main():
	for i in range(1, N - 1):
		for j in range(1, N - 1):
			if B[i][j] == '.' and B[i - 1][j] == '.' and (B[i + 1][j] == '.') and (B[i][j - 1] == '.') and (B[i][j + 1] == '.'):
				B[i][j] = '#'
				B[i - 1][j] = '#'
				B[i + 1][j] = '#'
				B[i][j - 1] = '#'
				B[i][j + 1] = '#'
	for i in range(N):
		if '.' in B[i]:
			print('NO')
			return
	print('YES')
	return
N = ii()
B = [sli() for _ in range(N)]
main()


n = int(input())
visit = set()
A = [['#'] * n] + [list(input()) for _ in range(n)] + [['#'] * n]
for i in range(len(A)):
	A[i] = ['#'] + A[i] + ['#']
for i in range(1, len(A) - 1):
	for j in range(1, len(A) - 1):
		if A[i][j] == '.' and i * 10 ** 5 + j not in visit:
			f = 1
			for (kek, lol) in ((i, j + 1), (i, j - 1), (i - 1, j), (i + 1, j)):
				if A[kek][lol] != '.' or kek * 10 ** 5 + lol in visit:
					f = 0
			if f:
				for (kek, lol) in ((i, j + 1), (i, j - 1), (i - 1, j), (i + 1, j)):
					visit.add(kek * 10 ** 5 + lol)
					visit.add(i * 10 ** 5 + j)
		elif A[i][j] == '#':
			visit.add(i * 10 ** 5 + j)
if len(visit) == n * n:
	print('YES')
else:
	print('NO')


def try_to_set(n, m, i, j):
	if i < n - 2 and j < n - 1 and (j > 0):
		if m[i][j] == '.' and m[i + 1][j] == '.' and (m[i + 2][j] == '.') and (m[i + 1][j - 1] == '.') and (m[i + 1][j + 1] == '.'):
			m[i][j] = '#'
			m[i + 1][j] = '#'
			m[i + 2][j] = '#'
			m[i + 1][j - 1] = '#'
			m[i + 1][j + 1] = '#'
n = int(input())
m = []
for i in range(n):
	l = list(input())
	m.append(l)
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			try_to_set(n, m, i, j)
possible = True
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			possible = False
if possible:
	print('YES')
else:
	print('NO')


n = int(input())
a_ = [list(input()) for _ in range(n)]
a = a_

def check(i, j):
	try:
		return all((a[i][j + k] == '.' and a[i - 1 + k][j + 1] == '.' for k in range(3)))
	except IndexError:
		return False

def fill(i, j):
	for k in range(3):
		a[i][j + k] = '#'
		a[i - 1 + k][j + 1] = '#'
all_good = True
for j in range(n):
	for i in range(n):
		if a[i][j] == '.':
			if check(i, j):
				fill(i, j)
			else:
				all_good = False
				break
	if not all_good:
		break
if all_good:
	print('YES')
else:
	print('NO')


def solve():
	n = int(input())
	b = [list(input()) for _ in range(n)]
	for i in range(n - 2):
		if b[i][0] == '.' or b[i][-1] == '.':
			return 'NO'
		for j in range(1, n - 1):
			if b[i][j] == '.':
				chg = [(i + 1, j), (i + 2, j), (i + 1, j - 1), (i + 1, j + 1)]
				for (x, y) in chg:
					if b[x][y] == '#':
						return 'NO'
					b[x][y] = '#'
	for i in range(n - 2, n):
		for j in range(n):
			if b[i][j] == '.':
				return 'NO'
	return 'YES'
print(solve())


n = int(input())
available = set()
cnt = 0
for i in range(n):
	s = input()
	for j in range(n):
		if s[j] == '.':
			available.add((i, j))
			cnt += 1

def check(r, c):
	for (i, j) in [(r + 1, c - 1), (r + 1, c), (r + 1, c + 1), (r + 2, c)]:
		if 0 <= i < n and 0 <= j < n:
			if (i, j) not in available:
				return False
		else:
			return False
	return True
mod = cnt % 5
if mod != 0:
	print('NO')
else:
	for i in range(n):
		for j in range(n):
			if (i, j) in available:
				if check(i, j):
					available.discard((i, j))
					available.discard((i + 1, j - 1))
					available.discard((i + 1, j))
					available.discard((i + 1, j + 1))
					available.discard((i + 2, j))
				else:
					print('NO')
					exit(0)
	print('YES')


R = lambda : map(int, input().split())
directions = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]
(n,) = R()
board = [list(input()) for i in range(n)]
for i in range(n - 2):
	for j in range(1, n - 1):
		is_dots = all((board[i + d][j + c] == '.' for (d, c) in directions))
		if is_dots:
			for (d, c) in directions:
				board[i + d][j + c] = '#'
dots = any((row.count('.') for row in board))
print('No' if dots else 'Yes')


n = int(input())
l = []
for i in range(n):
	s = input()
	l.append([c == '.' for c in s])

def check(i, j):
	res = l[i][j]
	res &= i < n - 1 and l[i + 1][j]
	res &= i < n - 2 and l[i + 2][j]
	if res:
		res &= j < n - 1 and l[i + 1][j + 1]
		res &= j > 0 and l[i + 1][j - 1]
	if res:
		l[i][j] = l[i + 1][j] = l[i + 2][j] = l[i + 1][j + 1] = l[i + 1][j - 1] = False
	return res
ans = True
for i in range(n):
	for j in range(n):
		if not l[i][j]:
			continue
		ans &= check(i, j)
print('YES' if ans else 'NO')


n = int(input())
A = []
for i in range(n):
	s = list(input())
	A.append(s)
ok = 1
for i in range(n - 2):
	for j in range(1, n - 1):
		if A[i][j] == '.' and A[i + 1][j] == '.' and (A[i + 2][j] == '.') and (A[i + 1][j - 1] == '.') and (A[i + 1][j + 1] == '.'):
			A[i][j] = '#'
			A[i + 1][j] = '#'
			A[i + 2][j] = '#'
			A[i + 1][j - 1] = '#'
			A[i + 1][j + 1] = '#'
ans = 0
for i in A:
	if '.' in i:
		ok = 0
if ok:
	print('YES')
else:
	print('NO')


def solve():
	n = int(input())
	board = [input() for _ in range(n)]
	b = [[0] * n for _ in range(n)]
	for i in range(n):
		for j in range(n):
			if board[i][j] == '#':
				b[i][j] = 1
			else:
				b[i][j] = 0
	for i in range(n):
		for j in range(n):
			if b[i][j] == 1:
				continue
			if j == 0 or j == n - 1 or i > n - 3:
				print('NO')
				return
			for (di, dj) in [(1, -1), (1, 0), (1, 1), (2, 0)]:
				x = i + di
				y = j + dj
				if b[x][y] == 1:
					print('NO')
					return
				b[x][y] = 1
	print('YES')
	return
solve()


n = int(input())
l = [list(input()) for i in range(n)]
for i in range(n - 2):
	for j in range(1, n - 1):
		if l[i][j] == l[i + 1][j - 1] == l[i + 1][j] == l[i + 1][j + 1] == l[i + 2][j] == '.':
			l[i][j] = l[i + 1][j - 1] = l[i + 1][j] = l[i + 1][j + 1] = l[i + 2][j] = '#'
if all([all([l[i][j] == '#' for j in range(n)]) for i in range(n)]):
	print('Yes')
else:
	print('No')


n = int(input())
field = [list(input()) for i in range(n)]
ans = 1
for i in range(n):
	for j in range(n):
		if field[i][j] == '.':
			if i > n - 3 or j == n - 1 or field[i + 1][j] != '.' or (field[i + 2][j] != '.') or (field[i + 1][j + 1] != '.') or (field[i + 1][j - 1] != '.'):
				ans = 0
				break
			field[i + 1][j] = '#'
			field[i + 2][j] = '#'
			field[i + 1][j + 1] = '#'
			field[i + 1][j - 1] = '#'
	if ans == 0:
		break
if ans == 1:
	print('YES')
else:
	print('NO')


n = int(input())
arr = []
for i in range(n):
	temp = list(input())
	arr.append(temp)
count = 1
for i in range(n - 2):
	for j in range(n - 1):
		if arr[i][j] == '.':
			if arr[i][j] != '#' and arr[i + 1][j] != '#' and (arr[i + 2][j] != '#') and (arr[i + 1][j - 1] != '#') and (arr[i + 1][j + 1] != '#'):
				arr[i][j] = '#'
				arr[i + 1][j] = '#'
				arr[i + 2][j] = '#'
				arr[i + 1][j - 1] = '#'
				arr[i + 1][j + 1] = '#'
flag = True
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			flag = False
if flag:
	print('YES')
else:
	print('NO')


import sys
n = int(input())
a = []
flag = False
for i in range(n):
	a.append(input())
for i in range(n):
	if flag:
		break
	for j in range(n):
		if a[i][j] == '.':
			if j < 1 or j >= n - 1 or i >= n - 2:
				print('NO')
				flag = True
				break
			else:
				a[i] = a[i][:j] + '#' + a[i][j + 1:]
				if a[i + 1][j - 1] != '.' or a[i + 1][j] != '.' or a[i + 1][j + 1] != '.' or (a[i + 2][j] != '.'):
					flag = True
					print('NO')
					break
				else:
					a[i + 1] = a[i + 1][:j - 1] + '###' + a[i + 1][j + 2:]
					a[i + 2] = a[i + 2][:j] + '#' + a[i + 2][j + 1:]
if not flag:
	print('YES')


def solve():
	N = int(input())
	board = []
	for _ in range(N):
		row = input()
		board.append(list(row))
	for i in range(N):
		for j in range(N):
			if board[i][j] == '.':
				if i < N - 2 and j > 0 and (j < N - 1) and (board[i + 1][j] == '.') and (board[i + 1][j - 1] == '.') and (board[i + 1][j + 1] == '.') and (board[i + 2][j] == '.'):
					board[i][j] = '#'
					board[i + 1][j] = '#'
					board[i + 1][j - 1] = '#'
					board[i + 1][j + 1] = '#'
					board[i + 2][j] = '#'
				else:
					print('NO')
					return
	for i in range(N):
		if '.' in board[i]:
			print('NO')
			return
	print('YES')
solve()


import sys
n = int(input())
a = [list(input()) for _ in range(n)]

def iszeroarr(ar):
	for row in ar:
		for symb in row:
			if symb != '#':
				return False
	return True
for i in range(n - 2):
	for j in range(n):
		if a[i][j] == '.':
			try:
				if a[i + 1][j - 1] == '.' and a[i + 1][j] == '.' and (a[i + 1][j + 1] == '.') and (a[i + 2][j] == '.'):
					a[i][j] = '#'
					a[i + 1][j - 1] = '#'
					a[i + 1][j] = '#'
					a[i + 1][j + 1] = '#'
					a[i + 2][j] = '#'
				else:
					print('NO')
					sys.exit(0)
			except IndexError:
				pass
print('YES' if iszeroarr(a) else 'NO')


ll = lambda : list(map(int, input().split()))
n = int(input())
inp = [input() for i in range(n)]
grid = [[] for i in range(n)]
count = 0
for i in range(n):
	for j in range(n):
		if inp[i][j] == '#':
			grid[i].append(0)
		else:
			grid[i].append(1)
			count += 1

def valid(i, j):
	if grid[i][j] & grid[i][j + 1] & grid[i][j - 1] & grid[i + 1][j] & grid[i - 1][j]:
		return True
	return False

def fill(i, j):
	(grid[i][j], grid[i][j + 1], grid[i][j - 1], grid[i + 1][j], grid[i - 1][j]) = (0, 0, 0, 0, 0)
if count % 5 != 0:
	print('NO')
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if valid(i, j):
				fill(i, j)
				count -= 5
	if count is 0:
		print('YES')
	else:
		print('NO')


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
n = int(input())
a = []
for _ in range(n):
	a.append([i for i in input()])
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if 0 <= i - 1 and i + 1 < n and (0 <= j) and (j + 1 < n):
				if a[i - 1][j] == a[i + 1][j] == a[i][j + 1] == a[i][j - 1] == '.':
					a[i - 1][j] = a[i + 1][j] = a[i][j + 1] = a[i][j - 1] = a[i][j] = '#'
for i in range(n):
	if '.' in a[i]:
		print('NO')
		exit()
print('YES')


n = int(input())
data = [['0' for i in range(n + 2)]]
for _ in range(n):
	data.append(['0'] + list(input()) + ['0'])
data.append(['0' for i in range(n + 2)])
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if data[i][j] == '.' and data[i - 1][j] == '.' and (data[i + 1][j] == '.') and (data[i][j - 1] == '.') and (data[i][j + 1] == '.'):
			data[i][j] = '#'
			data[i - 1][j] = '#'
			data[i + 1][j] = '#'
			data[i][j - 1] = '#'
			data[i][j + 1] = '#'
for i in range(1, n + 1):
	if data[i].__contains__('.'):
		print('NO')
		exit(0)
print('YES')


def solve():
	n = int(input())
	board = []
	for _ in range(n):
		board.append(list(input()))
	for i in range(n):
		for j in range(n):
			if board[i][j] == '.':
				if not (i + 2 < n and j - 1 >= 0 and (j + 1 < n)):
					return 'NO'
				if board[i + 1][j] == '#' or board[i + 2][j] == '#' or board[i + 1][j - 1] == '#' or (board[i + 1][j + 1] == '#'):
					return 'NO'
				board[i][j] = '#'
				board[i + 1][j] = '#'
				board[i + 2][j] = '#'
				board[i + 1][j - 1] = '#'
				board[i + 1][j + 1] = '#'
	return 'YES'
print(solve())


n = int(input())
grid = []
for i in range(n):
	grid.append(list(input()))

def can(grid):
	for i in range(n - 2):
		for j in range(1, n - 1):
			if grid[i][j] == '.':
				grid[i][j] = '#'
				if grid[i + 1][j - 1] == '.':
					grid[i + 1][j - 1] = '#'
				else:
					return False
				if grid[i + 1][j] == '.':
					grid[i + 1][j] = '#'
				else:
					return False
				if grid[i + 1][j + 1] == '.':
					grid[i + 1][j + 1] = '#'
				else:
					return False
				if grid[i + 2][j] == '.':
					grid[i + 2][j] = '#'
				else:
					return False
	for i in range(n):
		for j in range(n):
			if grid[i][j] == '.':
				return False
	return True
if can(grid):
	print('YES')
else:
	print('NO')


while True:
	try:
		n = int(input())
		b = [list(input()) for _ in range(n)]
		a = ((-1, 0), (1, 0), (0, 1), (0, -1))
		for r in range(1, n - 1):
			for c in range(1, n - 1):
				if b[r][c] == '.':
					alldot = True
					for (ro, co) in a:
						if b[r + ro][c + co] != '.':
							alldot = False
							break
					if alldot:
						b[r][c] = '#'
						for (ro, co) in a:
							b[r + ro][c + co] = '#'
		allhash = True
		for r in range(n):
			for c in range(n):
				if b[r][c] == '.':
					allhash = False
					break
			if not allhash:
				break
		print('YES' if allhash else 'NO')
	except:
		break


n = int(input())
g = []
good = []
for i in range(0, n):
	g.append(list(input()))
	good.append([])
	for j in range(0, len(g[-1])):
		if g[-1][j] == '#':
			good[-1].append(True)
		else:
			good[-1].append(False)
for i in range(1, len(g) - 1):
	for j in range(0, len(g) - 1):
		if not good[i][j]:
			if not good[i - 1][j] and (not good[i][j - 1]) and (not good[i][j + 1]) and (not good[i + 1][j]):
				good[i - 1][j] = True
				good[i][j - 1] = True
				good[i + 1][j] = True
				good[i][j + 1] = True
				good[i][j] = True
f = True
for i in good:
	for j in i:
		if not j:
			f = False
if f:
	print('YES')
else:
	print('NO')


def checkans(board):
	for i in range(1, n + 2):
		for j in range(1, n + 2):
			if board[i][j] == '.':
				return False
	else:
		return True
n = int(input())
board = [['#'] * (n + 2)]
for _ in range(n):
	board.append(['#'] + list(map(str, input())) + ['#'])
board = board + [['#'] * (n + 2)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if board[i][j] == '.':
			for k in range(4):
				if board[i + dx[k]][j + dy[k]] == '#':
					break
			else:
				for k in range(4):
					board[i + dx[k]][j + dy[k]] = '#'
				board[i][j] = '#'
if checkans(board):
	print('YES')
else:
	print('NO')


def solve(n, board):
	vectors = [(0, 0), (1, 0), (2, 0), (1, -1), (1, 1)]
	for row in range(n - 2):
		for col in range(1, n - 1):
			can_place = all([board[row + x][col + y] == '.' for (x, y) in vectors])
			if can_place:
				for (x, y) in vectors:
					board[row + x][col + y] = '#'
	if any(('.' in r for r in board)):
		return 'NO'
	else:
		return 'YES'

def main():
	n = int(input())
	board = [list(input()) for _ in range(n)]
	print(solve(n, board))
main()


def main():
	n = int(input())
	table = [list(input()) for _ in range(n)]
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if table[i - 1][j] == '.' and table[i][j - 1] == '.' and (table[i][j] == '.') and (table[i][j + 1] == '.') and (table[i + 1][j] == '.'):
				table[i - 1][j] = '#'
				table[i][j - 1] = '#'
				table[i][j] = '#'
				table[i][j + 1] = '#'
				table[i + 1][j] = '#'
	filled = all((all(map(lambda x: x == '#', row)) for row in table))
	print('YES' if filled else 'NO')
main()


n = int(input())
b = []
for i in range(n):
	b.append([c == '.' for c in input()])
pos = [(0, 0), (1, 0), (-1, 0), (0, 1), (0, -1)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if 5 == sum((b[i + x][j + y] for (x, y) in pos)):
			for (x, y) in pos:
				b[i + x][j + y] = 0
if sum([sum(c) for c in b]):
	print('NO')
else:
	print('YES')


n = int(input())
tile = []
for x in range(n):
	tile.append(list(input()))
kill = 0
for y in range(n - 2):
	for x in range(1, n - 1):
		if tile[y][x] == '.':
			if tile[y + 1][x + 1] == '.' and tile[y + 1][x - 1] == '.' and (tile[y + 2][x] == '.') and (tile[y + 1][x] == '.'):
				tile[y][x] = '#'
				tile[y + 1][x + 1] = '#'
				tile[y + 1][x] = '#'
				tile[y + 1][x - 1] = '#'
				tile[y + 2][x] = '#'
			else:
				kill = 1
				break
	if kill == 1:
		break
if kill == 0:
	t = 0
	for y in tile:
		if '.' in y:
			t = 1
			break
	if t == 0:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


l = []
i = int(input())
for _ in range(i):
	l.append([x for x in input()])

def finding(i, l):
	for a in range(i - 1):
		if '.' in l[a]:
			for b in range(1, i - 1):
				if l[a][b] == '.':
					try:
						if l[a + 1][b - 1:b + 2] == ['.', '.', '.'] and l[a + 2][b] == '.':
							l[a][b] = '#'
							(l[a + 1][b - 1], l[a + 1][b], l[a + 1][b + 1]) = ('#', '#', '#')
							l[a + 2][b] = '#'
					except:
						return 'NO'
	for n in l:
		if '.' in n:
			return 'NO'
	return 'YES'
print(finding(i, l))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():

	def isvalid(i, j):
		if 0 <= i < n and 0 <= j < n and (ar[i][j] == '.'):
			return 1
		return 0
	n = int(inp())
	ar = []
	for _ in range(n):
		temp = inp()
		t = []
		for i in temp:
			t.append(i)
		ar.append(t)
	tr = 1
	for i in range(n):
		for j in range(n):
			if ar[i][j] == '.':
				if isvalid(i + 1, j) and isvalid(i + 2, j) and isvalid(i + 1, j - 1) and isvalid(i + 1, j + 1):
					ar[i][j] = '#'
					ar[i + 1][j] = '#'
					ar[i + 2][j] = '#'
					ar[i + 1][j - 1] = '#'
					ar[i + 1][j + 1] = '#'
				else:
					tr = -1
					print('NO')
					exit()
	print('YES')
solve()


n = int(input())
grid = [list(input()) for row in range(n)]
ans = 'YES'
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			if j == 0 or i >= n - 2 or j == n - 1:
				ans = 'NO'
			elif '#' in grid[i + 1][j - 1:j + 2] or grid[i + 2][j] == '#':
				ans = 'NO'
			else:
				grid[i][j] = '#'
				for k in range(j - 1, j + 2):
					grid[i + 1][k] = '#'
				grid[i + 2][j] = '#'
print(ans)


w = int(input())
board = []
for _ in range(w):
	board.append([c for c in input()])
c = 0
e = 0
for i in range(w):
	for j in range(w):
		if board[i][j] == '.':
			try:
				e += 1
				if board[i + 1][j] == '.' and board[i + 1][j + 1] == '.' and (board[i + 1][j - 1] == '.') and (board[i + 2][j] == '.'):
					board[i + 1][j] = '#'
					board[i + 1][j + 1] = '#'
					board[i + 1][j - 1] = '#'
					board[i + 2][j] = '#'
					board[i][j] = '#'
					e += 4
					c += 1
			except:
				pass
if c * 5 != e:
	print('NO')
else:
	print('YES')


n = int(input())
l = [''] * n
for i in range(n):
	l[i] = list(input())
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == '.' and l[i][j - 1] == '.' and (l[i][j + 1] == '.') and (l[i - 1][j] == '.') and (l[i + 1][j] == '.'):
			l[i][j] = '#'
			l[i][j - 1] = '#'
			l[i][j + 1] = '#'
			l[i - 1][j] = '#'
			l[i + 1][j] = '#'
flag = 1
for i in range(n):
	for j in range(n):
		if l[i][j] != '#':
			flag = 0
if flag == 0:
	print('NO')
else:
	print('YES')


intin = lambda : map(int, input().split())
Ain = lambda : list(map(int, input().split()))
n = int(input())
a = [0] * n
flag = 'YES'
for i in range(n):
	a[i] = list(input())
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if i + 2 < n and j + 1 < n and (j > 0) and (a[i][j] == a[i + 1][j] == a[i + 2][j] == a[i + 1][j - 1] == a[i + 1][j + 1] == '.'):
				a[i][j] = a[i + 1][j] = a[i + 2][j] = a[i + 1][j - 1] = a[i + 1][j + 1] = '#'
			else:
				flag = 'NO'
				break
print(flag)


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if n - i < 3 or j == 0 or j == n - 1 or (a[i + 1][j] == '#') or (a[i + 2][j] == '#') or (a[i + 1][j + 1] == '#') or (a[i + 1][j - 1] == '#') or (a[i][j] == '#'):
				print('NO')
				return
			a[i][j] = '#'
			a[i + 1][j] = '#'
			a[i + 2][j] = '#'
			a[i + 1][j - 1] = '#'
			a[i + 1][j + 1] = '#'
print('YES')


from sys import stdin
a = []
n = int(stdin.readline())
for _ in range(n):
	a.append(list(stdin.readline().rstrip()))
res = True
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if i >= n - 2 or j == 0 or j == n - 1:
				res = False
				break
			if a[i + 1][j - 1] == '#' or a[i + 1][j] == '#' or a[i + 1][j + 1] == '#' or (a[i + 2][j] == '#'):
				res = False
				break
			a[i][j] = '#'
			for k in range(j - 1, j + 2):
				a[i + 1][k] = '#'
			a[i + 2][j] = '#'
	if not res:
		break
print(['NO', 'YES'][res])


n = int(input())
b = [list(input()) for _ in range(n)]
for i in range(n):
	for j in range(n):
		if b[i][j] == '.':
			if j < 1 or i > n - 3 or j > n - 2:
				print('NO')
				exit()
			if b[i + 1][j - 1] == '#' or b[i + 1][j] == '#' or b[i + 1][j + 1] == '#' or (b[i + 2][j] == '#'):
				print('NO')
				exit()
			b[i + 1][j - 1] = b[i + 1][j] = b[i + 1][j + 1] = b[i + 2][j] = b[i][j] = '#'
print('YES')


n = int(input())
s = [list(input()) for i in range(n)]
ans = 'YES'
for i in range(n - 2):
	for j in range(1, n - 1):
		if s[i][j] == '.':
			if s[i + 1][j - 1] == '.' and s[i + 1][j + 1] == '.' and (s[i + 1][j] == '.') and (s[i + 2][j] == '.'):
				s[i + 1][j + 1] = '#'
				s[i][j] = '#'
				s[i + 1][j - 1] = '#'
				s[i + 1][j] = '#'
				s[i + 2][j] = '#'
for i in s:
	if i.count('.') > 0:
		ans = 'NO'
print(ans)


n = int(input())
tab = []
for i in range(n):
	tab.append(list(input()))
z = True
for y in range(n):
	for x in range(n):
		if tab[y][x] == '.':
			tab[y][x] = '#'
			if y + 1 < n and x - 1 >= 0 and (tab[y + 1][x - 1] == '.'):
				tab[y + 1][x - 1] = '#'
			else:
				z = False
			if y + 1 < n and x + 1 < n and (tab[y + 1][x + 1] == '.'):
				tab[y + 1][x + 1] = '#'
			else:
				z = False
			if y + 1 < n and tab[y + 1][x] == '.':
				tab[y + 1][x] = '#'
			else:
				z = False
			if y + 2 < n and tab[y + 2][x] == '.':
				tab[y + 2][x] = '#'
			else:
				z = False
	if z == False:
		break
print('YES' if z == True else 'NO')


n = int(input())
matrix = []
for i in range(n):
	st = list(input())
	matrix.append(st)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if matrix[i][j] == '.':
			if matrix[i - 1][j] == '.' and matrix[i][j - 1] == '.' and (matrix[i][j + 1] == '.') and (matrix[i + 1][j] == '.'):
				matrix[i][j] = matrix[i - 1][j] = matrix[i][j - 1] = matrix[i][j + 1] = matrix[i + 1][j] = '#'
ans = []
for i in range(n):
	ans += matrix[i]
ans = set(ans)
if ans == {'#'}:
	print('YES')
else:
	print('NO')


n = int(input())
arr = []
c = 0
for i in range(n):
	s = input()
	c = c + s.count('.')
	arr.append(list(s))
if c % 5 != 0:
	print('NO')
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if arr[i][j] == '.' and arr[i - 1][j] == '.' and (arr[i + 1][j] == '.') and (arr[i][j - 1] == '.') and (arr[i][j + 1] == '.'):
				arr[i][j] = '#'
				arr[i - 1][j] = '#'
				arr[i + 1][j] = '#'
				arr[i][j - 1] = '#'
				arr[i][j + 1] = '#'
				c = c - 5
	if c == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
grid = [['#'] * (n + 2)] + [list('#' + input() + '#') for i in range(n)] + [['#'] * (n + 2)] * 2
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if grid[i][j] == '.':
			if grid[i - 1][j - 1:j + 2] == list('...') and grid[i - 2][j] == '.':
				grid[i - 1][j - 1:j + 2] = list('###')
				grid[i - 2][j] = '#'
				grid[i][j] = '#'
print(['YES', 'NO'][any((sum((j == '.' for j in i)) for i in grid))])


n = int(input())
fld = [[j for j in input()] for i in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if fld[i][j] != '#':
			if (fld[i + 1][j] != '#') & (fld[i][j + 1] != '#') & (fld[i - 1][j] != '#') & (fld[i][j - 1] != '#'):
				fld[i][j] = '#'
				fld[i + 1][j] = '#'
				fld[i][j + 1] = '#'
				fld[i - 1][j] = '#'
				fld[i][j - 1] = '#'
b = True
for i in fld:
	if '.' in i:
		b = False
		break
if b:
	print('YES')
else:
	print('NO')


n = int(input())
board = [[c for c in input()] for _ in range(n)]
for x in range(n):
	for y in range(n):
		if board[x][y] == '.':
			if y == n - 1 or x >= n - 2 or y == 0:
				print('NO')
				exit()
			board[x][y] = '#'
			if board[x + 1][y - 1] == '#':
				print('NO')
				exit()
			board[x + 1][y - 1] = '#'
			if board[x + 1][y] == '#':
				print('NO')
				exit()
			board[x + 1][y] = '#'
			if board[x + 1][y + 1] == '#':
				print('NO')
				exit()
			board[x + 1][y + 1] = '#'
			if board[x + 2][y] == '#':
				print('NO')
				exit()
			board[x + 2][y] = '#'
print('YES')


import sys
n = int(input())
rows = [list(input()) for i in range(n)]
for i in range(n - 2):
	for j in range(n):
		if rows[i][j] == '.':
			if j == 0 or j == n - 1:
				print('NO')
				sys.exit()
			elif rows[i + 1][j - 1] == '.' and rows[i + 1][j] == '.' and (rows[i + 1][j + 1] == '.') and (rows[i + 2][j] == '.'):
				rows[i][j] = '#'
				rows[i + 1][j - 1] = '#'
				rows[i + 1][j] = '#'
				rows[i + 1][j + 1] = '#'
				rows[i + 2][j] = '#'
			else:
				print('NO')
				sys.exit()
for i in range(n):
	for j in range(n):
		if rows[i][j] == '.':
			print('NO')
			sys.exit()
print('YES')


import sys
import math
import bisect

def solve(A):
	n = len(A)
	for i in range(n):
		for j in range(n):
			if A[i][j] == '.':
				val = 1
				if i + 1 < n and j - 1 >= 0 and (A[i + 1][j - 1] == '.'):
					val += 1
					A[i + 1][j - 1] = '#'
				if i + 1 < n and A[i + 1][j] == '.':
					val += 1
					A[i + 1][j] = '#'
				if i + 1 < n and j + 1 < n and (A[i + 1][j + 1] == '.'):
					val += 1
					A[i + 1][j + 1] = '#'
				if i + 2 < n and A[i + 2][j] == '.':
					val += 1
					A[i + 2][j] = '#'
				if val != 5:
					return False
	return True

def main():
	n = int(input())
	A = []
	for i in range(n):
		A.append(list(input()))
	if solve(A):
		print('YES')
	else:
		print('NO')
main()


n = int(input())
sp = [0] * n
for i in range(n):
	sp[i] = [0] * n
	s = input()
	for j in range(n):
		sp[i][j] = s[j]
flag = False
for i in range(n):
	for j in range(n):
		if sp[i][j] == '#':
			continue
		try:
			s = {sp[i][j], sp[i + 1][j], sp[i + 2][j], sp[i + 1][j - 1], sp[i + 1][j + 1]}
			if len(s) == 2:
				print('NO')
				flag = True
				exit()
			(sp[i][j], sp[i + 1][j], sp[i + 2][j], sp[i + 1][j - 1], sp[i + 1][j + 1]) = ('#', '#', '#', '#', '#')
		except:
			if not flag:
				print('NO')
			exit()
print('YES')


n = int(input())
mat = [input() for i in range(n)]
ma = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	for j in range(n):
		if mat[i][j] == '.':
			ma[i][j] = 1
odp = 0
ope = 0
while True:
	ope = 0
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if ma[i][j] == 1 and ma[i - 1][j] == 1 and (ma[i + 1][j] == 1) and (ma[i][j + 1] == 1) and (ma[i][j - 1] == 1):
				ma[i][j] = 0
				ma[i - 1][j] = 0
				ma[i + 1][j] = 0
				ma[i][j - 1] = 0
				ma[i][j + 1] = 0
				ope = 1
	if ope == 0:
		break
import sys
for i in range(n):
	for j in range(n):
		if ma[i][j] == 1:
			print('NO')
			sys.exit(0)
print('YES')


n = int(input())
A = [[i for i in input()] for j in range(n)]
for w in range(n):
	for h in range(n):
		if A[h][w] == '.' and (h == 0 or h == n - 1):
			print('NO')
			exit()
		if A[h][w] == '.':
			if w + 2 >= n or h - 1 < 0 or h + 1 >= n:
				print('NO')
				exit()
			if A[h][w + 1] == '#' or A[h][w + 2] == '#' or A[h + 1][w + 1] == '#' or (A[h - 1][w + 1] == '#'):
				print('NO')
				exit()
			A[h][w] = '#'
			A[h][w + 1] = '#'
			A[h][w + 2] = '#'
			A[h + 1][w + 1] = '#'
			A[h - 1][w + 1] = '#'
print('YES')


def check(i, j):
	global grid
	grid[i] = grid[i][:j] + '#' + grid[i][j + 1:]
	try:
		if grid[i + 1][j] == '.' and grid[i + 1][j - 1] == '.' and (grid[i + 1][j + 1] == '.') and (grid[i + 2][j] == '.'):
			grid[i + 1] = grid[i + 1][:j - 1] + '###' + grid[i + 1][j + 2:]
			grid[i + 2] = grid[i + 2][:j] + '#' + grid[i + 2][j + 1:]
			return True
		else:
			return False
	except:
		return False
n = int(input())
grid = [input() for i in range(n)]
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			if check(i, j):
				continue
			else:
				print('NO')
				exit(0)
print('YES')


n = int(input())
arr = []
for i in range(n):
	to_app = list(input())
	arr.append(to_app)
for i in range(n):
	for j in range(n):
		try:
			if arr[i][j] == '.' and arr[i + 1][j] == '.' and (arr[i + 1][j - 1] == '.') and (arr[i + 1][j + 1] == '.') and (arr[i + 2][j] == '.'):
				arr[i][j] = '#'
				arr[i + 1][j] = '#'
				arr[i + 1][j - 1] = '#'
				arr[i + 1][j + 1] = '#'
				arr[i + 2][j] = '#'
		except:
			IndexError
count = 0
for i in range(n):
	count += arr[i].count('.')
if count == 0:
	print('YES')
else:
	print('NO')


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if matrix[i][j] == '.':
			if matrix[i + 1][j] == '.' and matrix[i - 1][j] == '.' and (matrix[i][j + 1] == '.') and (matrix[i][j - 1] == '.'):
				matrix[i][j] = '#'
				matrix[i + 1][j] = '#'
				matrix[i - 1][j] = '#'
				matrix[i][j + 1] = '#'
				matrix[i][j - 1] = '#'
for i in range(n):
	for j in range(n):
		if matrix[i][j] == '.':
			print('NO')
			exit(0)
else:
	print('Yes')


n = int(input())
mp = [[] for i in range(n + 10)]
vis = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
	mp[i] = input()
flag = 1
for i in range(n):
	for j in range(n):
		if vis[i][j] == 1:
			continue
		if mp[i][j] == '.':
			try:
				if mp[i + 1][j] == '.' and mp[i + 1][j - 1] == '.' and (mp[i + 1][j + 1] == '.') and (mp[i + 2][j] == '.') and (vis[i + 1][j] == 0) and (vis[i + 1][j - 1] == 0) and (vis[i + 1][j + 1] == 0) and (vis[i + 2][j] == 0):
					vis[i][j] = 1
					vis[i + 1][j] = 1
					vis[i + 1][j - 1] = 1
					vis[i + 1][j + 1] = 1
					vis[i + 2][j] = 1
				else:
					flag = 0
			except:
				flag = 0
if flag == 0:
	print('NO')
else:
	print('YES')


import io, sys, atexit, os
import math as ma
from decimal import Decimal as dec
from itertools import permutations
from random import randint as rand

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007
yp = 0

def solve():
	t = 1
	for _ in range(t):
		n = nu()
		x = [0] * n
		for i in range(n):
			x[i] = [0] * n
			pp = input()
			for j in range(n):
				if pp[j] == '.':
					x[i][j] = 0
				else:
					x[i][j] = 1
		while True:
			fl = False
			for i in range(n):
				for j in range(n):
					if i - 1 >= 0 and i + 1 < n and (j - 1 >= 0) and (j + 1 < n):
						if x[i][j] == 0 and x[i - 1][j] == 0 and (x[i + 1][j] == 0) and (x[i][j + 1] == 0) and (x[i][j - 1] == 0):
							fl = True
							x[i][j] = 1
							x[i - 1][j] = 1
							x[i + 1][j] = 1
							x[i][j + 1] = 1
							x[i][j - 1] = 1
							break
				if fl:
					break
			if fl == False:
				break
		pw = True
		for i in range(n):
			for j in range(n):
				if x[i][j] == 0:
					pw = False
		if pw:
			print('YES')
		else:
			print('NO')

def __starting_point():
	solve()
__starting_point()


def main():
	n = int(input())
	arr = []
	for _ in range(n):
		arr.append(list(str(input())))
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if arr[i - 1][j] == '.' and arr[i][j] == '.' and (arr[i + 1][j] == '.') and (arr[i][j - 1] == '.') and (arr[i][j + 1] == '.'):
				arr[i - 1][j] = '-1'
				arr[i][j] = '-1'
				arr[i + 1][j] = '-1'
				arr[i][j - 1] = '-1'
				arr[i][j + 1] = '-1'
	for i in range(n):
		for j in range(n):
			if arr[i][j] == '.':
				print('NO')
				return
	print('YES')
	return
	return
main()


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]), reverse=True)

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	maxint = 10 ** 10
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] >= arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def solve():
	n = int(input())
	mat = []
	for i in range(n):
		mat.append(list(input()))
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if mat[i][j] == '.':
				if mat[i - 1][j] == '.' and mat[i + 1][j] == '.' and (mat[i][j - 1] == '.') and (mat[i][j + 1] == '.'):
					mat[i - 1][j] = mat[i + 1][j] = mat[i][j - 1] = mat[i][j + 1] = mat[i][j] = '#'
	for i in range(n):
		for j in range(n):
			if mat[i][j] == '.':
				print('NO')
				return
	print('YES')
t = 1
for _ in range(t):
	solve()


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import *
from itertools import *
import functools
import sys
from math import *
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN(x=' '):
	return map(int, sys.stdin.readline().strip().split(x))

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN():
	return list(numIN())

def dis(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def res(ans, t):
	print('Case #{}: {} {}'.format(t, ans[0], ans[1]))
n = int(input())
l = []
for _ in range(n):
	l.append([i for i in input()])
for i in range(n - 2):
	for j in range(1, n - 1):
		if l[i][j] == '.':
			if l[i + 1][j] == '.' and l[i + 2][j] == '.' and (l[i + 1][j + 1] == '.') and (l[i + 1][j - 1] == '.'):
				(l[i + 1][j], l[i + 1][j + 1], l[i + 1][j - 1], l[i + 2][j], l[i][j]) = ('#', '#', '#', '#', '#')
for i in range(n):
	for j in range(n):
		if l[i][j] == '.':
			print('NO')
			exit(0)
print('YES')


n = int(input())
daf = []
for i in range(n):
	daf.append(list(input()))
flag = False
for x in range(n):
	for y in range(n):
		if daf[x][y] == '#':
			continue
		else:
			try:
				c1 = daf[x + 1][y]
				c2 = daf[x + 1][y - 1]
				c3 = daf[x + 1][y + 1]
				c4 = daf[x + 2][y]
				if all([c1 == '.', c2 == '.', c3 == '.', c4 == '.']):
					daf[x + 1][y] = '#'
					daf[x + 1][y - 1] = '#'
					daf[x + 1][y + 1] = '#'
					daf[x + 2][y] = '#'
				else:
					flag = True
					break
			except:
				flag = True
				break
	if flag:
		print('NO')
		break
else:
	print('YES')


n = int(input())
d = []
for i in range(n):
	d.append([q == '.' for q in input()])
pos = [(0, 0), (0, 1), (0, -1), (-1, 0), (1, 0)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if 5 == sum((d[i + a][j + b] for (a, b) in pos)):
			for (a, b) in pos:
				d[i + a][j + b] = 0
if sum([sum(q) for q in d]):
	print('NO')
else:
	print('YES')


n = int(input())
A = [0] * n
DX = [0, 0, 0, -1, 1]
DY = [0, -1, 1, 0, 0]

def hole(x, y):
	for i in range(0, 5):
		if A[x + DX[i]][y + DY[i]] != 0:
			return False
	return True

def fill(x, y):
	for i in range(0, 5):
		A[x + DX[i]][y + DY[i]] = 1
for i in range(0, n):
	A[i] = input()
	temp = [0] * n
	for j in range(0, n):
		if A[i][j] == '.':
			temp[j] = 0
		else:
			temp[j] = 1
	A[i] = temp
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if hole(i, j):
			fill(i, j)
for i in range(0, n):
	for j in range(0, n):
		if A[i][j] == 0:
			print('NO')
			exit(0)
print('YES')


n = int(input())
b = []
for _ in range(n):
	b.append(list(map(lambda x: 0 if x == '.' else 1, input())))
for i in range(n - 2):
	for j in range(1, n - 1):
		if b[i][j] == 0:
			b[i][j] = 1
			b[i + 1][j - 1] += 1
			b[i + 1][j] += 1
			b[i + 1][j + 1] += 1
			b[i + 2][j] += 1
print('YES' if min(min(b)) == max(max(b)) == 1 else 'NO')


m = int(input())
n = []
for i in range(m):
	k = input()
	j = []
	for i in range(len(k)):
		j.append(k[i:i + 1])
	n.append(j)
for i in range(m):
	for j in range(m):
		if i != m - 1 and j != 0 and (j != m - 1) and (i != m - 2) and (n[i][j] == '.'):
			if n[i + 1][j - 1] == '.' and n[i + 1][j] == '.' and (n[i + 1][j + 1] == '.') and (n[i + 2][j] == '.'):
				n[i][j] = '#'
				n[i + 1][j - 1] = '#'
				n[i + 1][j + 1] = '#'
				n[i + 1][j] = '#'
				n[i + 2][j] = '#'
h = 0
for i in n:
	for j in i:
		if j == '#':
			h += 1
if h == m ** 2:
	print('YES')
else:
	print('NO')


def solve(pos):
	global flag, table, n
	x = pos[1]
	for i in range(pos[0], n):
		for j in range(x, n):
			if table[i][j] == '.':
				table[i][j] = '#'
				if not isok(i, j):
					flag = False
					return (-1, -1)
				elif table[i + 1][j] == '.':
					table[i + 1][j] = '#'
					if table[i + 2][j] == '.':
						table[i + 2][j] = '#'
						if table[i + 1][j - 1] == '.':
							table[i + 1][j - 1] = '#'
							if table[i + 1][j + 1] == '.':
								table[i + 1][j + 1] = '#'
								return (i, j)
							else:
								flag = False
								return (-1, -1)
						else:
							flag = False
							return (-1, -1)
					else:
						flag = False
						return (-1, -1)
				else:
					flag = False
					return (-1, -1)
		x = 0

def isok(i, j):
	global n
	if n - 2 > i > -1 and n - 1 > j > 0:
		return True
	return False

def check():
	global n, table
	for i in range(n):
		for j in range(n):
			if table[i][j] == '.':
				return True
	return False
n = int(input())
table = [[i for i in input()] for j in range(n)]
flag = True
pos = (0, 0)
while flag and check():
	pos = solve(pos)
if check() or not flag:
	print('NO')
else:
	print('YES')


try:
	n = input()
	n = int(n)
	c = []
	d = []
	temp = []
	flag = 0
	for i in range(n):
		c.append(input())
	for i in range(n):
		for j in range(n):
			if c[i][j] == '.':
				temp.append(0)
			else:
				temp.append(1)
		d.append(temp)
		temp = []
	for i in range(n):
		for j in range(n):
			if d[i][j] == 0:
				if d[i + 1][j] != 0 or d[i + 1][j - 1] != 0 or d[i + 1][j + 1] != 0 or (d[i + 2][j] != 0):
					exit()
				else:
					d[i + 1][j] = 1
					d[i + 1][j - 1] = 1
					d[i + 1][j + 1] = 1
					d[i + 2][j] = 1
					d[i][j] = 1
	print('YES')
except:
	print('NO')


n = int(input())
g = [list(input()) for _ in range(n)]
f = 1
for i in range(n):
	for j in range(n):
		if '.' == g[i][j]:
			if i + 2 < n and 0 < j < n - 1 and ('.' == g[i + 1][j] == g[i + 1][j - 1] == g[i + 1][j + 1] == g[i + 2][j]):
				g[i][j] = g[i + 1][j] = g[i + 1][j - 1] = g[i + 1][j + 1] = g[i + 2][j] = '#'
			else:
				f = 0
				break
print(('NO', 'YES')[f])


import sys
from collections import defaultdict
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
n = int(input())
floor = []
for i in range(n):
	floor.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if floor[i][j] == '.' and floor[i][j + 1] == '.' and (floor[i][j - 1] == '.') and (floor[i - 1][j] == '.') and (floor[i + 1][j] == '.'):
			floor[i][j] = '#'
			floor[i][j + 1] = '#'
			floor[i][j - 1] = '#'
			floor[i - 1][j] = '#'
			floor[i + 1][j] = '#'
noDot = True
for i in range(n):
	for j in range(n):
		if floor[i][j] == '.':
			noDot = False
			break
if noDot:
	print('YES')
else:
	print('NO')


n = int(input())
a = [[x for x in str(input())] for _ in range(n)]

def chk(a):
	for i in range(n):
		for j in range(n):
			if a[i][j] == '.':
				a[i][j] = '#'
				for (x0, y0) in [(1, -1), (1, 0), (1, 1), (2, 0)]:
					x = i + x0
					y = j + y0
					if 0 <= x < n and 0 <= y < n and (a[x][y] == '.'):
						a[x][y] = '#'
					else:
						return 'NO'
	return 'YES'
print(chk(a))


n = int(input())
tile = [list(input()) for _ in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if tile[i][j] == '.':
			if tile[i - 1][j] == '.' and tile[i + 1][j] == '.' and (tile[i][j - 1] == '.') and (tile[i][j + 1] == '.'):
				tile[i][j] = '#'
				tile[i - 1][j] = '#'
				tile[i + 1][j] = '#'
				tile[i][j - 1] = '#'
				tile[i][j + 1] = '#'
			else:
				pass
flag = True
for i in range(n):
	for j in range(n):
		if tile[i][j] == '.':
			flag = False
			break
if flag:
	print('YES')
else:
	print('NO')


def can(i, j):
	return 0 < i < n - 1 and 0 < j < n - 1 and g[i][j + 1] and g[i + 1][j] and g[i][j - 1] and g[i - 1][j] and g[i][j]

def fill(i, j):
	g[i][j] = 0
	g[i + 1][j] = 0
	g[i - 1][j] = 0
	g[i][j + 1] = 0
	g[i][j - 1] = 0
n = int(input())
g = []
for _ in range(n):
	g.append([1 if x == '.' else 0 for x in input()])
for i in range(n):
	for j in range(n):
		if can(i, j):
			fill(i, j)
v = True
for i in range(n):
	for j in range(n):
		if g[i][j]:
			v = False
print('YES' if v else 'NO')


n = int(input())
(inp, a) = ([], 0)
for i in range(n):
	s = input()
	a += s.count('.')
	inp.append(list(s))
if a % 5 != 0 or inp[0][0] == '.' or inp[-1][-1] == '.' or (inp[0][-1] == '.') or (inp[-1][0] == '.'):
	print('NO')
	exit()
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if inp[i][j] == inp[i][j - 1] == inp[i][j + 1] == '.':
			if inp[i - 1][j] == '.' and inp[i + 1][j] == '.':
				inp[i - 1][j] = '#'
				inp[i + 1][j] = '#'
				inp[i][j - 1] = '#'
				inp[i][j] = '#'
				inp[i][j + 1] = '#'
				a -= 5
print('YES' if a == 0 else 'NO')


import sys
side = int(input())
array = []
for i in range(side):
	array.append([s for s in input()])
for i in range(1, side - 1):
	for j in range(1, side - 1):
		if array[i][j] == '.' and array[i - 1][j] == '.' and (array[i][j - 1] == '.') and (array[i + 1][j] == '.') and (array[i][j + 1] == '.'):
			array[i][j] = '#'
			array[i - 1][j] = '#'
			array[i][j - 1] = '#'
			array[i + 1][j] = '#'
			array[i][j + 1] = '#'
for i in range(side):
	for j in range(side):
		if array[i][j] == '.':
			print('NO')
			sys.exit(0)
print('YES')


n = int(input())
S = [list(input()) for x in range(n)]
dx = [0, -1, 0, 1]
dy = [1, 0, -1, 0]
for i in range(n):
	for j in range(n):
		if i == 0 or j == 0 or i == n - 1 or (j == n - 1) or (S[i][j] == '#'):
			continue
		count = 0
		for k in range(4):
			x = i + dx[k]
			y = j + dy[k]
			if S[x][y] == '.':
				count += 1
		if count == 4:
			S[i][j] = '#'
			for k in range(len(dx)):
				x = i + dx[k]
				y = j + dy[k]
				S[x][y] = '#'
flag = True
for i in range(n):
	for j in range(n):
		if S[i][j] == '.':
			flag = False
if flag:
	print('YES')
else:
	print('NO')


n = int(input())
arr = [list(input()) for _ in range(n)]
for i in range(n):
	for j in range(n):
		if i == 0 or i == n - 1 or j == 0 or (j == n - 1):
			continue
		if arr[i][j] == '#':
			continue
		if arr[i - 1][j] == '#' or arr[i + 1][j] == '#' or arr[i][j - 1] == '#' or (arr[i][j + 1] == '#'):
			continue
		arr[i][j] = '#'
		arr[i][j + 1] = '#'
		arr[i][j - 1] = '#'
		arr[i + 1][j] = '#'
		arr[i - 1][j] = '#'
f = True
for i in arr:
	if '.' in i:
		f = False
		break
print('YES' if f else 'NO')


n = int(input())
matrix = []
s_0 = [0] * (n + 2)
matrix.append(s_0)
for i in range(n):
	s = [0]
	string = str(input())
	for j in range(n):
		if string[j] == '#':
			s.append(0)
		else:
			s.append(1)
	s.append(0)
	matrix.append(s)
matrix.append(s_0)

def dfs(i, j, matrix):
	if matrix[i - 1][j] == 1 and matrix[i][j - 1] == 1 and (matrix[i][j + 1] == 1) and (matrix[i + 1][j] == 1):
		return True
	else:
		return False
res = 0
for i in range(n + 2):
	res += sum(matrix[i])
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if matrix[i][j] == 1:
			if dfs(i, j, matrix) == True:
				matrix[i - 1][j] = 0
				matrix[i][j - 1] = 0
				matrix[i][j] = 0
				matrix[i][j + 1] = 0
				matrix[i + 1][j] = 0
				res = res - 5
if res == 0:
	print('YES')
else:
	print('NO')


n = int(input())
lst = []
f = 0
for i in range(n):
	ls = input()
	ls = list(ls)
	lst.append(ls)
i = 0
while i < n:
	if '.' in lst[i]:
		l = lst[i].index('.')
		if l == 0 or l == n - 1:
			f = 1
			print('NO')
			break
		elif i < n - 2:
			if lst[i + 1][l - 1] != '.' or lst[i + 1][l] != '.' or lst[i + 1][l + 1] != '.' or (lst[i + 2][l] != '.'):
				f = 1
				print('NO')
				break
			else:
				lst[i][l] = '#'
				lst[i + 1][l - 1] = '#'
				lst[i + 1][l] = '#'
				lst[i + 1][l + 1] = '#'
				lst[i + 2][l] = '#'
		else:
			f = 1
			print('NO')
			break
	if '.' not in lst[i]:
		i += 1
if f == 0:
	print('YES')


cases = int(input())
matrix = []
while cases:
	cases -= 1
	s = list(input())
	matrix.append(s)
for row in range(1, len(matrix) - 1):
	for column in range(1, len(matrix[0]) - 1):
		if matrix[row][column] == matrix[row + 1][column] == matrix[row - 1][column] == matrix[row][column + 1] == matrix[row][column - 1] == '.':
			matrix[row][column] = matrix[row + 1][column] = matrix[row - 1][column] = matrix[row][column + 1] = matrix[row][column - 1] = '#'
for row in matrix:
	if '.' in row:
		print('NO')
		exit()
print('YES')


n = int(input())
a = [[0] * n for i in range(n)]
for i in range(n):
	b = input().rstrip()
	for j in range(n):
		a[i][j] = b[j]
fla = 0
for i in range(n):
	for j in range(n):
		gg1 = 0
		gg2 = 0
		gg3 = 0
		gg4 = 0
		if a[i][j] == '.':
			if i + 1 < n and i - 1 >= 0 and (j - 1 >= 0) and (j + 1 < n):
				if a[i + 1][j] == '.' and a[i - 1][j] == '.' and (a[i][j + 1] == '.') and (a[i][j - 1] == '.'):
					a[i + 1][j] = '#'
					a[i - 1][j] = '#'
					a[i][j + 1] = '#'
					a[i][j - 1] = '#'
					a[i][j] = '#'
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			fla = 1
			break
if fla == 1:
	print('NO')
else:
	print('YES')


n = int(input().strip())
l = []
for k in range(n):
	l.append(input().strip())
ll = []
for k in range(n):
	lll = []
	for kk in range(n):
		if l[k][kk] == '#':
			lll.append(0)
		else:
			lll.append(1)
	ll.append(lll)
pos = 1
for k in range(n):
	for kk in range(n):
		if ll[k][kk]:
			if kk == 0:
				pos = 0
			elif kk == n - 1:
				pos = 0
			elif k > n - 3:
				pos = 0
			elif not ll[k + 1][kk - 1] or not ll[k + 1][kk] or (not ll[k + 1][kk + 1]) or (not ll[k + 2][kk]):
				pos = 0
			else:
				ll[k + 1][kk - 1] = 0
				ll[k + 1][kk] = 0
				ll[k + 1][kk + 1] = 0
				ll[k + 2][kk] = 0
				ll[k][kk] = 0
			if pos == 0:
				break
	if pos == 0:
		break
if pos:
	print('YES')
else:
	print('NO')


n = int(input())
arr = []
for i in range(n):
	arr.append(list(input()))
offset = [[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1]]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if arr[i][j] == '.':
			fl = True
			for t in offset:
				if arr[i + t[0]][j + t[1]] == '#':
					fl = False
					break
			if fl:
				for t in offset:
					arr[i + t[0]][j + t[1]] = '#'
res = True
for i in range(len(arr)):
	for j in range(len(arr[i])):
		if arr[i][j] == '.':
			res = False
if res:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
for _ in range(n):
	l.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == '.':
			if l[i][j - 1] == l[i][j + 1] == l[i + 1][j] == l[i - 1][j] == '.':
				l[i][j - 1] = l[i][j + 1] = l[i + 1][j] = l[i - 1][j] = l[i][j] = '#'
set_ = set()
for i in l:
	for j in i:
		set_.add(j)
if len(set_) == 1:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	k = list(input())
	l.append(k)
c = 0
for i in range(n):
	for j in range(n):
		if l[i][j] == '.':
			c += 1
k = [[True for i in range(n)] for i in range(n)]
e = 0
for i in range(n):
	for j in range(n):
		if l[i][j] == '.' and k[i][j]:
			t = True
			if i + 1 < n and i - 1 > -1 and (j + 1 < n) and (j - 1 > -1):
				if l[i + 1][j] == '.' and l[i - 1][j] == '.' and (l[i][j + 1] == '.') and (l[i][j - 1] == '.'):
					if k[i + 1][j] and k[i - 1][j] and k[i][j - 1] and k[i][j + 1] and k[i][j]:
						e += 5
						k[i + 1][j] = False
						k[i - 1][j] = False
						k[i][j + 1] = False
						k[i][j - 1] = False
						k[i][j] = False
if e == c:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l = l + [input()]
for i in range(n - 2):
	if l[i][0] == '.':
		break
	for j in range(n - 1):
		if l[i][j] == '.' and l[i + 1][j] == '.' and (l[i + 2][j] == '.') and (l[i + 1][j + 1] == '.') and (l[i + 1][j - 1] == '.'):
			l[i] = l[i][:j] + '#' + l[i][j + 1:]
			l[i + 1] = l[i + 1][:j - 1] + '###' + l[i + 1][j + 2:]
			l[i + 2] = l[i + 2][:j] + '#' + l[i + 2][j + 1:]
for i in range(n):
	k = l[i].count('.')
	if l[i].count('.') > 0:
		break
if k > 0:
	print('NO')
else:
	print('YES')


n = int(input())
s = [[]] * n

def fuck(x, y):
	if s[x][y] == '.' and s[x + 1][y] == '.' and (s[x][y + 1] == '.') and (s[x - 1][y] == '.') and (s[x][y - 1] == '.'):
		s[x][y] = s[x][y + 1] = s[x + 1][y] = s[x - 1][y] = s[x][y - 1] = '#'
for i in range(n):
	s[i] = input()
	s[i] = list(s[i])
for i in range(1, n - 1):
	for j in range(1, n - 1):
		fuck(i, j)
for i in range(n):
	for j in range(n):
		if s[i][j] == '.':
			print('NO')
			exit()
print('YES')


def B():
	n = int(input())
	G = [list(input()) for _ in range(n)]
	for i in range(n):
		for j in range(n):
			if G[i][j] == '.':
				if i + 2 < n and 0 < j < n - 1 and (G[i + 1][j - 1:j + 2] == ['.'] * 3) and (G[i + 2][j] == '.'):
					(G[i + 1][j - 1:j + 2], G[i + 2][j]) = ('###', '#')
				else:
					return 1
	return 0
print('YNEOS'[B()::2])


n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(str, input())))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if arr[i][j] == '.':
			if arr[i][j + 1] == '.' and arr[i][j - 1] == '.' and (arr[i + 1][j] == '.') and (arr[i - 1][j] == '.'):
				arr[i][j] = '#'
				arr[i - 1][j] = '#'
				arr[i + 1][j] = '#'
				arr[i][j - 1] = '#'
				arr[i][j + 1] = '#'
f = 0
for i in arr:
	if '.' in i:
		f = 1
		break
if f == 1:
	print('NO')
else:
	print('YES')


import itertools as it

def main():
	n = int(input())
	m = [list(input()) for i in range(n)]
	for i in range(n):
		for j in range(n):
			c = 0
			if m[i][j] == '.':
				c += 1
			if i - 1 >= 0 and m[i - 1][j] == '.':
				c += 1
			if j - 1 >= 0 and m[i][j - 1] == '.':
				c += 1
			if i + 1 < n and m[i + 1][j] == '.':
				c += 1
			if j + 1 < n and m[i][j + 1] == '.':
				c += 1
			if c == 5:
				(m[i][j], m[i - 1][j], m[i][j - 1], m[1 + i][j], m[i][j + 1]) = ('#', '#', '#', '#', '#')
	m = list(it.chain.from_iterable(m))
	print('YES' if '.' not in m else 'NO')
main()


def try_t(i, j):
	if i < 0 or i >= n or j < 0 or (j >= n):
		return False
	if A[i][j] == '#':
		return False
	A[i][j] = '#'
	return True
n = int(input())
A = []
for i in range(n):
	s = input()
	B = []
	for elem in s:
		B.append(elem)
	A.append(B)
T = True
for i in range(n):
	for j in range(n):
		if A[i][j] == '.':
			a1 = try_t(i + 1, j)
			a2 = try_t(i + 2, j)
			a3 = try_t(i + 1, j + 1)
			a4 = try_t(i + 1, j - 1)
			if not (a1 and a2 and a3 and a4):
				T = False
				break
if T:
	print('YES')
else:
	print('NO')


n = int(input())
board = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	b = list(input())
	for j in range(n):
		if b[j] == '#':
			board[i][j] = 1
can = True
vectors = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]
for i in range(n - 2):
	if not can:
		break
	for j in range(1, n - 1):
		if board[i][j] == 0:
			for (x, y) in vectors:
				if board[i + x][j + y] == 0:
					board[i + x][j + y] = 1
				else:
					can = False
					break
	if board[i][0] == 0 or board[i][n - 1] == 0:
		can = False
		break
for i in range(n - 2, n):
	for j in range(0, n):
		if board[i][j] == 0:
			can = False
			break
if can:
	print('YES')
else:
	print('NO')


n = int(input())
s = [list(input()) for i in range(n)]
for i in range(n):
	for j in range(n):
		if s[i][j] == '.':
			for k in [[i + 1, j - 1], [i + 1, j], [i + 1, j + 1], [i + 2, j]]:
				if not (0 <= k[0] < n and 0 <= k[1] < n):
					print('NO')
					exit()
				if s[k[0]][k[1]] == '#':
					print('NO')
					exit()
				s[k[0]][k[1]] = '#'
print('YES')


n = int(input())
x = [0] * n
s = 0
for i in range(n):
	x[i] = [0] * n
	l = input()
	for j in range(n):
		x[i][j] = l[j]
	s += x[i].count('.')
for i in range(n):
	for j in range(n):
		if i + 2 < n and j + 1 < n and (j - 1 >= 0):
			if x[i][j] == '.' and x[i + 1][j] == '.' and (x[i + 2][j] == '.') and (x[i + 1][j - 1] == '.') and (x[i + 1][j + 1] == '.'):
				x[i][j] = '#'
				x[i + 1][j] = '#'
				x[i + 2][j] = '#'
				x[i + 1][j - 1] = '#'
				x[i + 1][j + 1] = '#'
				s -= 5
if s == 0:
	print('YES')
else:
	print('NO')


n = int(input())
b = []
(s, m) = (0, 0)
for i in range(n):
	l = input()
	a = []
	for j in range(n):
		a.append(l[j])
	b.append(a)
for i in range(0, n):
	for j in range(0, n):
		if b[i][j] == '.':
			m = m + 1
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if b[i][j] == '.':
			if b[i][j + 1] == '.' and b[i - 1][j] == '.' and (b[i + 1][j] == '.') and (b[i][j - 1] == '.'):
				s = s + 1
				b[i][j] = '*'
				b[i][j + 1] = '*'
				b[i][j - 1] = '*'
				b[i + 1][j] = '*'
				b[i - 1][j] = '*'
if 5 * s == m:
	print('YES')
else:
	print('NO')


n = int(input())
grid = [list(input()) for _ in range(n)]
work = True
for i in range(n):
	for j in range(n):
		if grid[i][j] != '.':
			continue
		pos = [(i, j), (i + 1, j), (i + 2, j), (i + 1, j - 1), (i + 1, j + 1)]
		for (r, c) in pos:
			if r < 0 or r >= n or c < 0 or (c >= n) or (grid[r][c] == '#'):
				work = False
				break
			grid[r][c] = '#'
		else:
			continue
		break
	else:
		continue
	break
if work:
	print('YES')
else:
	print('NO')


from collections import defaultdict

def main():
	n = int(input())
	g = [[] for _ in range(n)]
	for r in range(n):
		g[r] = list(input())

	def empty(r, c):
		return g[r][c] == '.'

	def can(r, c):
		return 0 <= r < n and 0 <= c < n and empty(r, c)
	for r in range(n):
		for c in range(n):
			if g[r][c] == '.':
				if can(r, c) and can(r + 1, c) and can(r + 1, c - 1) and can(r + 1, c + 1) and can(r + 2, c):
					g[r][c] = g[r + 1][c] = g[r + 1][c - 1] = g[r + 1][c + 1] = g[r + 2][c] = '#'
	ok = True
	for r in range(n):
		for c in range(n):
			if empty(r, c):
				ok = False
				break
		if not ok:
			break
	print('YES' if ok else 'NO')
main()


n = int(input())
a = []
for i in range(n):
	s = input()
	a.append(s)
	if i < 2:
		continue
	for j in range(n - 2):
		if a[i - 1][j:j + 3] == '...' and a[i - 2][j + 1] == '.' and (a[i][j + 1] == '.'):
			a[i - 2] = a[i - 2][:j + 1] + '#' + a[i - 2][j + 2:]
			a[i - 1] = a[i - 1][:j] + '###' + a[i - 1][j + 3:]
			a[i] = a[i][:j + 1] + '#' + a[i][j + 2:]
out = 'YES'
for i in range(n):
	if a[i].find('.') > -1:
		out = 'NO'
print(out)


n = int(input())
place = []
c = 0
for i in range(n):
	place.append(list(input()))
	c += place[-1].count('.')
if c == 0:
	print('YES')
elif c % 5:
	print('NO')
else:
	while c > 0:
		x = -1
		while x < 0:
			if place[0].count('.') != 0:
				x = place[0].index('.')
			else:
				place = place[1:]
		if len(place) < 3 or not 0 < x < n - 1:
			print('NO')
			c = -1
		elif '#' in [place[1][x - 1], place[1][x], place[1][x + 1], place[2][x]]:
			print('NO')
			c = -1
		else:
			place[0][x] = '#'
			place[1][x] = '#'
			place[1][x - 1] = '#'
			place[1][x + 1] = '#'
			place[2][x] = '#'
			c -= 5
	if c == 0:
		print('YES')


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if matrix[i][j] == '.' and matrix[i][j - 1] == '.' and (matrix[i][j + 1] == '.') and (matrix[i + 1][j] == '.') and (matrix[i - 1][j] == '.'):
			matrix[i][j] = '#'
			matrix[i + 1][j] = '#'
			matrix[i - 1][j] = '#'
			matrix[i][j - 1] = '#'
			matrix[i][j + 1] = '#'
s = 0
for i in range(n):
	s += matrix[i].count('.')
if s == 0:
	print('YES')
else:
	print('NO')


(X, N) = ([], int(input()))
for i in range(N):
	X.append(list(input()))
for i in range(1, N - 1):
	for j in range(1, N - 1):
		if X[i][j] != '#' and X[i - 1][j] + X[i][j - 1] + X[i + 1][j] + X[i][j + 1] == '....':
			(X[i][j], X[i - 1][j], X[i][j - 1], X[i + 1][j], X[i][j + 1]) = ('#', '#', '#', '#', '#')
for i in range(N):
	if '.' in X[i]:
		print('NO')
		exit()
print('YES')


n = int(input())
board = [[0 for i in range(n)] for j in range(n)]
possible = [[False for i in range(n)] for j in range(n)]
free = 0
for i in range(n):
	line = input()
	for j in range(n):
		if line[j] == '.':
			board[i][j] = 0
			free += 1
		else:
			board[i][j] = -1

def pos(i, j, n, board, possible):
	if board[i][j] == -1:
		return False
	if i == 0 or j == 0:
		return False
	if i == n - 1 or j == n - 1:
		return False
	if board[i][j - 1] != -1 and board[i][j + 1] != -1 and (board[i - 1][j] != -1) and (board[i + 1][j] != -1):
		possible[i][j] = True
		return True
	return False

def fill(i, j, board, n, possible):
	board[i][j] = -1
	board[i][j - 1] = -1
	board[i][j + 1] = -1
	board[i - 1][j] = -1
	board[i + 1][j] = -1

def sum(i, j, board, n, q):
	board[i][j] += q
	board[i][j - 1] += q
	board[i][j + 1] += q
	board[i - 1][j] += q
	board[i + 1][j] += q

def check(board, i, j, possible):
	if possible[i][j]:
		return 0
	if possible[i - 1][j]:
		return 1
	if possible[i + 1][j]:
		return 2
	if possible[i][j - 1]:
		return 3
	if possible[i][j + 1]:
		return 4
if free % 5 != 0:
	print('NO')
	exit()

def clear(board, n, possible):
	for i in range(n):
		for j in range(n):
			if board[i][j] != -1:
				board[i][j] = 0
			possible[i][j] = False
	for i in range(n):
		for j in range(n):
			if pos(i, j, n, board, possible):
				sum(i, j, board, n, 1)
clear(board, n, possible)
while free > 0:
	retry = False
	for i in range(n):
		if retry:
			break
		for j in range(n):
			if board[i][j] == 1:
				side = check(board, i, j, possible)
				if side == 0:
					fill(i, j, board, n, possible)
				if side == 1:
					fill(i - 1, j, board, n, possible)
				if side == 2:
					fill(i + 1, j, board, n, possible)
				if side == 3:
					fill(i, j - 1, board, n, possible)
				if side == 4:
					fill(i, j + 1, board, n, possible)
				free -= 5
				clear(board, n, possible)
				retry = True
				break
	if not retry:
		break
if free == 0:
	print('YES')
else:
	print('NO')


import sys

def fill(i, j, board, n):
	board[i][j] = 1
	for d in range(-1, 2):
		if 0 <= i + 1 < n and 0 <= j + d < n and (board[i + 1][j + d] == 0):
			board[i + 1][j + d] = 1
		else:
			return False
	if i + 2 < n and board[i + 2][j] == 0:
		board[i + 2][j] = 1
	else:
		return False
	return True

def gao(n, board):
	for i in range(n):
		for j in range(n):
			if board[i][j] == 0:
				ret = fill(i, j, board, n)
				if not ret:
					return False
	return True

def main():
	l1 = sys.stdin.readline().rstrip('\n\r ')
	n = int(l1)
	board = []
	for i in range(n):
		line = sys.stdin.readline().rstrip('\n\r ')
		row = [0 if c == '.' else 1 for c in line]
		board.append(row)
	ret = gao(n, board)
	if ret:
		print('YES')
	else:
		print('NO')
main()


n = int(input())
bo = []
for i in range(n):
	f = list(input())
	bo.append(f)
cnt = 0
i = 0

def check(i, j):
	if 0 <= i < n and 0 <= j < n and (bo[i][j] == '.'):
		return True
	return False
flag = True
while flag and i < n:
	while cnt < n:
		if bo[i][cnt] == '#':
			cnt += 1
		else:
			bo[i][cnt] = '#'
			if check(i + 1, cnt - 1) and check(i + 1, cnt) and check(i + 1, cnt + 1) and check(i + 2, cnt):
				bo[i + 1][cnt - 1] = '#'
				bo[i + 1][cnt] = '#'
				bo[i + 1][cnt + 1] = '#'
				bo[i + 2][cnt] = '#'
			else:
				flag = False
				break
			cnt += 1
	i += 1
	cnt = 0
print('YES' if flag else 'NO')


n = int(input())
points = 0
deck = [list(input()) for i in range(n)]
for line in deck:
	points += line.count('.')
if points % 5:
	print('NO')
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if deck[i][j] == '.':
				if deck[i - 1][j] == '.':
					if deck[i + 1][j] == '.':
						if deck[i][j - 1] == '.':
							if deck[i][j + 1] == '.':
								points -= 5
								deck[i][j] = '#'
								deck[i - 1][j] = '#'
								deck[i + 1][j] = '#'
								deck[i][j - 1] = '#'
								deck[i][j + 1] = '#'
	if points:
		print('NO')
	else:
		print('YES')


n = int(input())
board = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	b = list(input())
	for j in range(n):
		if b[j] == '#':
			board[i][j] = 1
can = True
for i in range(n):
	if not can:
		break
	for j in range(n):
		if board[i][j] == 0:
			board[i][j] = 0
			if i + 1 < n and board[i + 1][j] == 0:
				board[i + 1][j] = 1
			else:
				can = False
				break
			if i + 2 < n and board[i + 2][j] == 0:
				board[i + 2][j] = 1
			else:
				can = False
				break
			if i + 1 < n and j + 1 < n and (board[i + 1][j + 1] == 0):
				board[i + 1][j + 1] = 1
			else:
				can = False
				break
			if i + 1 < n and j - 1 >= 0 and (board[i + 1][j - 1] == 0):
				board[i + 1][j - 1] = 1
			else:
				can = False
				break
if can:
	print('YES')
else:
	print('NO')


n = int(input())
li = []
for i4 in range(n):
	li.append(list(input()))
for i in range(0, n - 2):
	for j in range(1, n - 1):
		if li[i][j] == '.':
			if li[i + 1][j - 1] == '.' and li[i + 1][j] == '.' and (li[i + 1][j + 1] == '.'):
				if li[i + 2][j] == '.':
					li[i + 1][j - 1] = '#'
					li[i + 1][j] = '#'
					li[i + 1][j + 1] = '#'
					li[i + 2][j] = '#'
					li[i][j] = '#'
if all((x.count('.') == 0 for x in li)) == True:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
for j in range(n):
	l.append(list(input()))
f = 'NO'
for i in range(n - 2):
	for j in range(len(l[i]) - 1):
		if l[i][j] == '.':
			if l[i + 1][j] == '.' and l[i + 1][j + 1] == '.' and (l[i + 1][j - 1] == '.'):
				if l[i + 2][j] == '.':
					f = 'YES'
					l[i][j] = '#'
					l[i + 1][j] = '#'
					l[i + 1][j + 1] = '#'
					l[i + 1][j - 1] = '#'
					l[i + 2][j] = '#'
				else:
					pass
			else:
				pass
		else:
			pass
for i in range(n):
	for j in range(len(l[i])):
		if l[i][j] == '.':
			f = 'NO'
			break
print(f)


n = int(input())
s = [0] * n
for i in range(n):
	temp = list(input())
	s[i] = temp
mark = 1
for i in range(n - 2):
	if mark == 0:
		break
	for j in range(n - 1):
		if s[i][j] == '.':
			if s[i + 1][j] == '.' and s[i + 2][j] == '.' and (s[i + 1][j + 1] == '.') and (s[i + 1][j - 1] == '.'):
				s[i][j] = '#'
				s[i + 1][j] = '#'
				s[i + 2][j] = '#'
				s[i + 1][j + 1] = '#'
				s[i + 1][j - 1] = '#'
			else:
				mark = 0
				break
for i in range(n):
	if s[i][n - 1] == '.':
		mark = 0
for i in range(n):
	if s[n - 2][i] == '.':
		mark = 0
for i in range(n):
	if s[n - 1][i] == '.':
		mark = 0
if mark == 0:
	print('NO')
else:
	print('YES')


def tryfill(field, i, j):
	cells = ((i, j), (i + 1, j), (i + 2, j), (i + 1, j + 1), (i + 1, j - 1))
	n = len(field)
	if any((not (0 <= row < n and 0 <= col < n and (field[row][col] == '.')) for (row, col) in cells)):
		return False
	for (row, col) in cells:
		field[row][col] = '#'
	return True
n = int(input('').strip())
field = []
filled = 0
for _ in range(n):
	row = [c for c in input('').strip()]
	filled += sum((1 for c in row if c == '#'))
	field += [row]

def fillme(field, filled):
	n = len(field)
	for (i, row) in enumerate(field):
		for (j, cell) in enumerate(row):
			if cell == '.':
				if not tryfill(field, i, j):
					return False
				filled += 5
			if filled == n * n:
				return True
	return False
print('YES' if fillme(field, filled) else 'NO')
exit()

def getnext(row, col):
	if col < n - 1:
		return (row, col + 1)
	elif row < n - 1:
		return (row + 1, 0)
	else:
		return (None, None)

def isfilled(field, filled, row, col):
	if len(field) * len(field) == filled:
		return True
	if row is None or col is None:
		return False
	if field[row][col] == '.':
		if not tryfill(field, row, col):
			return False
		filled += 5
	(ii, jj) = getnext(row, col)
	return isfilled(field, filled, ii, jj)
print('YES' if isfilled(field, filled, 0, 0) else 'NO')


n = int(input())
figures = []
for i in range(n):
	figures.append(list(input()))
mark = []
count = 0
points = 0
for i in range(n):
	for j in range(n):
		if figures[i][j] == '.':
			points += 1
if points % 5 != 0:
	print('NO')
else:
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if figures[i][j] == '#':
				continue
			is_continue = True
			if [i - 1, j] in mark:
				is_continue = False
			if [i + 1, j] in mark:
				is_continue = False
			if [i, j - 1] in mark:
				is_continue = False
			if [i, j + 1] in mark:
				is_continue = False
			if is_continue:
				if figures[i][j] == '.' and figures[i - 1][j] == '.' and (figures[i + 1][j] == '.') and (figures[i][j - 1] == '.') and (figures[i][j + 1] == '.'):
					mark.append([i, j])
					mark.append([i - 1, j])
					mark.append([i + 1, j])
					mark.append([i, j - 1])
					mark.append([i, j + 1])
					count += 5
	print('YES' if count == points else 'NO')


a = int(input())
b = []
o = 0
q = 0
for j in range(a):
	c = list(input())
	b.append(c)
for j in range(a - 2):
	p = b[j]
	w = p.count('.')
	for k in range(w):
		q = p.index('.')
		if q == 0 or q == a - 1:
			print('NO')
			o = 1
			break
		else:
			m = b[j + 1]
			n = b[j + 2]
			if m[q] != '.' or m[q - 1] != '.' or m[q + 1] != '.' or (n[q] != '.'):
				print('NO')
				o = 1
				break
			else:
				m[q] = m[q - 1] = m[q + 1] = n[q] = p[q] = '#'
	if o == 1:
		break
else:
	m = b[-1]
	n = b[-2]
	m = m.count('.')
	n = n.count('.')
	if m > 0 or n > 0:
		print('NO')
	else:
		print('YES')


n = int(input())
count = 0
countplus = 0
b = []
for i in range(n):
	a = input()
	b.append(list(a))
	count += a.count('.')
if count % 5 != 0:
	print('NO')
	exit(0)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if b[i][j] == '.' and b[i - 1][j] == '.' and (b[i + 1][j] == '.') and (b[i][j - 1] == '.') and (b[i][j + 1] == '.'):
			b[i][j] = '#'
			b[i - 1][j] = '#'
			b[i + 1][j] = '#'
			b[i][j - 1] = '#'
			b[i][j + 1] = '#'
			countplus += 1
if countplus * 5 == count:
	print('YES')
else:
	print('NO')


def place(A, N, y, x):
	dy = [0, 1, 1, 1, 2]
	dx = [0, -1, 0, 1, 0]
	for i in range(5):
		if A[y + dy[i]][x + dx[i]] != '.':
			return False
		A[y + dy[i]][x + dx[i]] = '@'
	return True

def solve():
	N = int(input())
	A = [list(input()) for i in range(N)]
	for y in range(N - 2):
		for x in range(1, N - 1):
			if A[y][x] == '.':
				r = place(A, N, y, x)
				if not r:
					return 'NO'
	for y in range(N):
		for x in range(N):
			if A[y][x] == '.':
				return 'NO'
	return 'YES'
print(solve())


n = int(input())
s = [input() for j in range(n)]
arr = []
for x in s:
	temp = ['#', '#']
	for y in x:
		temp += [y]
	temp += ['#', '#']
	arr += [temp]
arr = [['#'] * (n + 4)] * 2 + arr + [['#'] * (n + 4)] * 2
for x in range(2, n + 1):
	for y in range(2, n + 1):
		if arr[x][y] == '.' and arr[x - 1][y] == '.' and (arr[x + 1][y] == '.') and (arr[x][y - 1] == '.') and (arr[x][y + 1] == '.'):
			arr[x][y] = arr[x - 1][y] = arr[x + 1][y] = arr[x][y - 1] = arr[x][y + 1] = '#'
ans = 'YES'
for x in arr:
	for y in x:
		if y == '.':
			ans = 'NO'
print(ans)


import collections
import time
import os
import sys
import bisect
import heapq
N = int(input())
A = []
for i in range(N):
	row = [True if x != '#' else False for x in list(input())]
	A.append(row)
for r in range(N):
	for c in range(N):
		if A[r][c]:
			for (nr, nc) in [(r + 1, c), (r + 1, c - 1), (r + 1, c + 1), (r + 2, c)]:
				if 0 <= nr < N and 0 <= nc < N and A[nr][nc]:
					A[nr][nc] = False
				else:
					print('NO')
					exit(0)
print('YES')


import sys
input = sys.stdin.readline
N = int(input())
A = [input() for _ in range(N)]
flag = 0
for i in range(N):
	for j in range(N):
		if A[i][j] == '.':
			if i + 2 >= N or j + 1 >= N or j - 1 < 0:
				flag = 1
			elif A[i + 1][j] == A[i + 2][j] == A[i + 1][j - 1] == A[i + 1][j + 1] == '.':
				A[i] = A[i][:j] + '#' + A[i][j + 1:]
				A[i + 2] = A[i + 2][:j] + '#' + A[i + 2][j + 1:]
				A[i + 1] = A[i + 1][:j - 1] + '###' + A[i + 1][j + 2:]
			else:
				flag = 1
if flag == 1:
	print('NO')
else:
	print('YES')


n = int(input())
flag = 0
d = []
for i in range(n):
	d.append(list(input()))
for j in range(n - 2):
	for i in range(1, n - 1):
		if d[j][i] == '.':
			if d[j + 1][i - 1] == '.' and d[j + 1][i] == '.' and (d[j + 1][i + 1] == '.') and (d[j + 2][i] == '.'):
				d[j + 1][i - 1] = '#'
				d[j][i] = '#'
				d[j + 1][i] = '#'
				d[j + 1][i + 1] = '#'
				d[j + 2][i] = '#'
			else:
				flag = 1
				break
ll = '#' * n
for i in d:
	if ''.join(i) != ll:
		flag = 1
		break
if flag == 1:
	print('NO')
else:
	print('YES')


n = int(input())
s = [list(input()) for i in range(n)]
w = sum([i.count('.') for i in s])
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if s[i][j] == '.':
			t = [-1, 1, 0, 0]
			p = [0, 0, 1, -1]
			c = 0
			for (q, r) in zip(t, p):
				if s[i + q][j + r] == '.':
					c += 1
				else:
					break
			else:
				(s[i][j], s[i][j - 1], s[i][j + 1], s[i + 1][j], s[i - 1][j]) = ('#', '#', '#', '#', '#')
				w -= 5
else:
	if w == 0:
		print('YES')
	else:
		print('NO')


import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def linp():
	return list(map(int, input().split()))
n = int(input())
l = [0 for i in range(n)]
for i in range(n):
	l[i] = list(input())
try:
	for i in range(n):
		for j in range(n):
			if l[i][j] == '.':
				if l[i + 1][j] == '.' and l[i + 2][j] == '.' and (l[i + 1][j + 1] == '.') and (l[i + 1][j - 1] == '.'):
					l[i + 1][j] = l[i + 1][j - 1] = l[i + 1][j + 1] = l[i + 2][j] = '#'
				else:
					l[1][1][1]
	print('YES')
except:
	print('NO')


import atexit
import io
import sys
_I_B = sys.stdin.read().splitlines()
input = iter(_I_B).__next__
_O_B = io.StringIO()
sys.stdout = _O_B

@atexit.register
def write():
	sys.__stdout__.write(_O_B.getvalue())

def main():
	n = int(input())
	b = []
	for _ in range(n):
		b.append(list(input()))
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if b[i][j] == '.' and b[i - 1][j] == '.' and (b[i][j - 1] == '.') and (b[i + 1][j] == '.') and (b[i][j + 1] == '.'):
				b[i][j] = '#'
				b[i - 1][j] = '#'
				b[i][j - 1] = '#'
				b[i + 1][j] = '#'
				b[i][j + 1] = '#'
	for i in b:
		if '.' in i:
			print('NO')
			exit()
	print('YES')
main()


import sys
input = sys.stdin.readline
n = int(input())
grid = []
for i in range(n):
	grid.append(list(input().strip()))

def check(i, j):
	if grid[i][j] == '.' and grid[i - 1][j] == '.' and (grid[i][j - 1] == '.') and (grid[i + 1][j] == '.') and (grid[i][j + 1] == '.'):
		grid[i][j] = '#'
		grid[i - 1][j] = '#'
		grid[i][j - 1] = '#'
		grid[i + 1][j] = '#'
		grid[i][j + 1] = '#'
for i in range(1, n - 1):
	for j in range(1, n - 1):
		check(i, j)
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			print('NO')
			sys.exit(0)
print('YES')


import math
import bisect
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
I = lambda : int(input())
tup = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))
t = 1
while t:
	n = I()
	arr = [list(input()) for i in range(n)]
	if arr[0][0] == '.' or arr[0][n - 1] == '.' or arr[n - 1][0] == '.' or (arr[n - 1][n - 1] == '.'):
		print('NO')
		break
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if arr[i][j] == '.':
				if arr[i - 1][j] == '.' and arr[i][j + 1] == '.' and (arr[i + 1][j] == '.') and (arr[i][j - 1] == '.'):
					arr[i - 1][j] = '#'
					arr[i][j + 1] = '#'
					arr[i + 1][j] = '#'
					arr[i][j - 1] = '#'
					arr[i][j] = '#'
	flag = False
	for i in range(n):
		for j in range(n):
			if arr[i][j] == '.':
				flag = True
				break
		if flag:
			break
	if flag:
		print('NO')
	else:
		print('YES')
	t -= 1


from collections import deque
N = int(input())
ba = [input() for _ in range(N)]
map = [[0] * N for _ in range(N)]
for x in range(N):
	for y in range(N):
		if ba[x][y] == '#':
			map[x][y] = 1
for x in range(N):
	for y in range(N):
		if map[x][y] == 1:
			continue
		else:
			count = 0
			for (j, k) in ([-1, 0], [0, -1], [1, 0], [0, 1]):
				new_x = x + j
				new_y = y + k
				if new_x < 0 or new_x >= N or new_y < 0 or (new_y >= N):
					continue
				elif map[new_x][new_y] == 0:
					count = count + 1
					if count == 4:
						map[x][y] = 1
						map[x + 1][y] = 1
						map[x][y + 1] = 1
						map[x - 1][y] = 1
						map[x][y - 1] = 1
ten = 0
for x in range(N):
	for y in range(N):
		if map[x][y] == 1:
			ten = ten + 1
if ten == N ** 2:
	print('YES')
else:
	print('NO')


from sys import setcheckinterval, setrecursionlimit, stdout, stdin
setcheckinterval(1000)
setrecursionlimit(10 ** 6)
iin = lambda : int(stdin.readline())
lin = lambda : list(map(int, stdin.readline().split()))
n = iin()
a1 = [input() for i in range(n)]
a = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
	for j in range(n):
		if a1[i][j] == '#':
			a[i][j] = 1
for i in range(n):
	for j in range(n):
		if a[i][j] == 0:
			try:
				if a[i + 1][j] == 0 and a[i + 2][j] == 0 and (a[i + 1][j - 1] == 0) and (a[i + 1][j + 1] == 0):
					a[i][j] = 1
					a[i + 1][j] = 1
					a[i + 2][j] = 1
					a[i + 1][j - 1] = 1
					a[i + 1][j + 1] = 1
			except:
				pass
for i in range(n):
	for j in range(n):
		if a[i][j] == 0:
			print('NO')
			exit()
print('YES')


def can_cover(i, j, matrix, n):
	if i >= 0 and i + 2 < n and (j - 1 >= 0) and (j + 1 < n):
		return matrix[i][j] == 1 and matrix[i + 1][j] == 1 and (matrix[i + 2][j] == 1) and (matrix[i + 1][j - 1] == 1) and (matrix[i + 1][j + 1] == 1)
	return False

def cover(i, j, matrix, n):
	matrix[i][j] = 0
	matrix[i + 1][j] = 0
	matrix[i + 2][j] = 0
	matrix[i + 1][j - 1] = 0
	matrix[i + 1][j + 1] = 0

def tiling(matrix, n, white_c):
	for i in range(n):
		for j in range(n):
			if matrix[i][j] == 1:
				if can_cover(i, j, matrix, n):
					cover(i, j, matrix, n)
					white_c -= 5
	if white_c == 0:
		return 'YES'
	else:
		return 'NO'
n = int(input())
matrix = [[0 for _ in range(n)] for _ in range(n)]
white_c = 0
for i in range(n):
	line = input()
	for j in range(len(line)):
		if line[j] == '.':
			matrix[i][j] = 1
			white_c += 1
print(tiling(matrix, n, white_c))


n = int(input())
S = []
free_count = 0
busy_count = 0
for i in range(n):
	s_cur = [_ for _ in list(input())]
	free_count += s_cur.count('.')
	busy_count += s_cur.count('#')
	S.append(s_cur)
if free_count % 5 != 0 or busy_count != n ** 2 - free_count:
	print('NO')
else:
	for i in range(1, n - 1):
		s_prev = S[i - 1]
		s_next = S[i + 1]
		for j in range(1, n - 1):
			if S[i][j] == S[i][j - 1] == S[i][j + 1] == '.':
				if s_prev[j] == '.' and s_next[j] == '.':
					S[i - 1][j] = '#'
					S[i + 1][j] = '#'
					S[i][j - 1] = '#'
					S[i][j] = '#'
					S[i][j + 1] = '#'
					free_count -= 5
	if free_count == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
s = []
for i in range(n):
	s.append(list(input()))
flag = 1
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if s[i][j] == '.':
			tmp = 1
			for (x, y) in ((0, 0), (-1, 0), (0, -1), (0, 1), (1, 0)):
				if s[i + x][j + y] != '.':
					tmp = 0
			if tmp:
				for (x, y) in ((0, 0), (-1, 0), (0, -1), (0, 1), (1, 0)):
					s[i + x][j + y] = '#'
for i in range(n):
	if s[i].count('.'):
		flag = 0
print('YES' if flag else 'NO')


n = int(input())
arr = []
for i in range(n):
	s = input()
	arr.append(s)
mp = {}
for i in range(n - 2):
	for j in range(1, n - 1):
		if str(i) + ' ' + str(j) in mp:
			continue
		if arr[i][j] == '.':
			if arr[i + 1][j] == '.' and (not str(i + 1) + ' ' + str(j) in mp):
				if arr[i + 2][j] == '.' and (not str(i + 2) + ' ' + str(j) in mp):
					if arr[i + 1][j + 1] == '.' and (not str(i + 1) + ' ' + str(1 + j) in mp):
						if arr[i + 1][j - 1] == '.' and (not str(i + 1) + ' ' + str(j - 1) in mp):
							mp[str(i) + ' ' + str(j)] = 1
							mp[str(i + 1) + ' ' + str(j + 1)] = 1
							mp[str(i + 1) + ' ' + str(j - 1)] = 1
							mp[str(i + 2) + ' ' + str(j)] = 1
							mp[str(i + 1) + ' ' + str(j)] = 1
st = 0
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			if str(i) + ' ' + str(j) not in mp:
				st = 1
if st:
	print('NO')
else:
	print('YES')


lstx = [0, 0, -1, 1, 0]
lsty = [-1, 1, 0, 0, 0]
n = int(input())
arr = []

def check(x, y, n):
	for k in range(4):
		if x + lstx[k] < 0 or x + lstx[k] >= n or y + lsty[k] < 0 or (y + lsty[k] >= n) or (arr[x + lstx[k]][y + lsty[k]] == 1):
			return 0
	for k in range(5):
		arr[x + lstx[k]][y + lsty[k]] = 1
for i in range(n):
	s = input()
	c = []
	for j in s:
		if j == '.':
			c.append(0)
		else:
			c.append(1)
	arr.append(c.copy())
for i in range(n):
	for j in range(n):
		if arr[i][j] == 0:
			z = check(i, j, n)
for i in range(n):
	for j in range(n):
		if arr[i][j] == 0:
			print('NO')
			exit()
print('YES')


board = []
lineSpace = []
freeSpaces = 0
for i in range(int(input())):
	board.append([i for i in input()])
	lineSpace.append(board[i].count('.'))
	freeSpaces += lineSpace[i]
if freeSpaces % 5:
	print('NO')
else:
	for i in range(1, len(board) - 1):
		for j in range(1, len(board) - 1):
			if board[i][j] == '.' and board[i + 1][j] == '.' and (board[i - 1][j] == '.') and (board[i][j + 1] == '.') and (board[i][j - 1] == '.'):
				board[i][j] = '#'
				board[i + 1][j] = '#'
				board[i - 1][j] = '#'
				board[i][j + 1] = '#'
				board[i][j - 1] = '#'
	isFlag = True
	for i in range(len(board)):
		if board[i].count('.') > 0:
			print('NO')
			isFlag = False
			break
	if isFlag:
		print('YES')


N = int(input())
board = [list(input()) for row_id in range(N)]

def legalBoard(board, N):
	for i in range(N):
		for j in range(N):
			if board[i][j] == '.':
				if j == 0 or j >= N - 1:
					return False
				if i >= N - 2:
					return False
				if board[i + 1][j] == '#' or board[i + 2][j] == '#' or board[i + 1][j - 1] == '#' or (board[i + 1][j + 1] == '#'):
					return False
				else:
					board[i][j] = '#'
					board[i + 1][j] = '#'
					board[i + 2][j] = '#'
					board[i + 1][j - 1] = '#'
					board[i + 1][j + 1] = '#'
	return True
if legalBoard(board, N):
	print('YES')
else:
	print('NO')


def main():
	n = int(input())
	table = []
	for i in range(n):
		table.append(list(input()))
	for i in range(n):
		for j in range(n):
			if table[i][j] == '.':
				if j == 0 or j == n - 1 or i > n - 3:
					print('NO')
					return
				if table[i + 1][j - 1] == '.' and table[i + 1][j] == '.' and (table[i + 1][j + 1] == '.') and (table[i + 2][j] == '.'):
					(table[i][j], table[i + 1][j - 1], table[i + 1][j], table[i + 1][j + 1], table[i + 2][j]) = ('#', '#', '#', '#', '#')
				else:
					print('NO')
					return
	print('YES')
main()


def solve():
	n = int(input())
	board = []
	d = [(0, 0), (1, 0), (-1, 0), (0, 1), (0, -1)]
	for i in range(n):
		board.append(list(input().strip()))
	for row in range(1, n - 1):
		for column in range(1, n - 1):
			if all((board[row + dx][column + dy] == '.' for (dx, dy) in d)):
				for (dx, dy) in d:
					board[row + dx][column + dy] = '#'
	if all((board[row][column] == '#' for row in range(n) for column in range(n))):
		print('YES')
	else:
		print('NO')
solve()


n = int(input())
a = []
for i in range(n):
	s = list(input())
	a.append(s)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i + 1][j] == '.') and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
			a[i - 1][j] = '#'
			a[i + 1][j] = '#'
			a[i][j] = '#'
			a[i][j + 1] = '#'
			a[i][j - 1] = '#'
f = 1
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			f = 0
			break
	if not f:
		break
if f:
	print('YES')
else:
	print('NO')


FREE = '.'
NOT_FREE = '#'

class Grid(object):

	def __init__(self, n):
		self.n = n
		self.cells = [n * [0] for _ in range(n)]

	def solve(self):
		n = self.n
		for i in range(n):
			for j in range(n):
				if self.can_place(i, j):
					self.place(i, j)
		for i in range(n):
			for j in range(n):
				if self.cells[i][j] == FREE:
					print('NO')
					return
		print('YES')

	def can_place(self, i, j):
		n = self.n
		if i == 0 or i == n - 1 or j == 0 or (j == n - 1):
			return False
		spots = [(i, j), (i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j)]
		for s in spots:
			if self.cells[s[0]][s[1]] == NOT_FREE:
				return False
		return True

	def place(self, i, j):
		spots = [(i, j), (i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j)]
		for s in spots:
			self.cells[s[0]][s[1]] = NOT_FREE

def main():
	n = int(input().strip())
	grid = Grid(n)
	for i in range(n):
		row = input().strip()
		for j in range(n):
			grid.cells[i][j] = row[j]
	grid.solve()
main()


n = int(input())
A = [list(input()) for _ in range(n)]
for i in range(n - 2):
	for j in range(1, n - 1):
		if A[i][j] == A[i + 1][j - 1] == A[i + 1][j] == A[i + 1][j + 1] == A[i + 2][j] == '.':
			A[i][j] = A[i + 1][j - 1] = A[i + 1][j] = A[i + 1][j + 1] = A[i + 2][j] = '#'
print('NO' if any(('.' in row for row in A)) else 'YES')


n = int(input())
m = [list(input()) for i in range(n)]
flag = 0
for i in range(n):
	for j in range(n):
		if i == n - 2 or i == n - 1 or j == 0 or (i == n - 1):
			if m[i][j] == '.':
				flag = 1
				break
		elif m[i][j] == '.':
			if m[i + 1][j - 1:j + 2] == ['.', '.', '.'] and m[i + 2][j] == '.':
				m[i][j] = '#'
				m[i + 1][j - 1:j + 2] = ['#', '#', '#']
				m[i + 2][j] = '#'
			else:
				flag = 1
				break
if flag == 0:
	print('YES')
else:
	print('NO')


n = int(input())
grid = []
for i in range(n):
	grid.append(list(input()))
flag = True
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			if j - 1 < 0 or j + 1 >= n or i >= n - 2:
				flag = False
				break
			if grid[i + 1][j - 1] != '.' or grid[i + 1][j] != '.' or grid[i + 1][j + 1] != '.' or (grid[i + 2][j] != '.'):
				flag = False
				break
			grid[i][j] = 'x'
			grid[i + 1][j - 1] = 'x'
			grid[i + 1][j] = 'x'
			grid[i + 1][j + 1] = 'x'
			grid[i + 2][j] = 'x'
	if not flag:
		break
if flag:
	print('YES')
else:
	print('NO')


N = int(input())
grid = [[x == '#' for x in input()] for _ in range(N)]
for i in range(N - 2):
	for j in range(N - 1):
		if not grid[i][j]:
			if grid[i + 1][j - 1] or grid[i + 1][j] or grid[i + 1][j + 1] or grid[i + 2][j]:
				print('NO')
				break
			grid[i][j] = grid[i + 1][j - 1] = grid[i + 1][j] = grid[i + 1][j + 1] = grid[i + 2][j] = 1
	else:
		continue
	break
else:
	if all(map(all, grid)):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
n = int(input())
cord = []
for _ in range(n):
	cord.append(list(input()))
d = [(1, 0), (1, -1), (2, 0), (1, 1)]

def solve():
	for i in range(n):
		for j in range(n):
			if cord[i][j] == '.':
				for (di, dj) in d:
					new_i = i + di
					new_j = j + dj
					if 0 <= new_i < n and 0 <= new_j < n:
						if cord[new_i][new_j] == '.':
							cord[new_i][new_j] = '#'
						else:
							return False
					else:
						return False
	return True
ans = solve()
if ans:
	print('YES')
else:
	print('NO')


import sys
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
n = int(input())
e = []
aki = 0
for i in range(n):
	t = deque(list(input()))
	e.append(t)
	aki += t.count('.')
if aki % 5 != 0:
	print('NO')
else:
	for i in range(n):
		for j in range(n):
			if i + 2 >= n:
				continue
			if j - 1 < 0:
				continue
			if j + 1 >= n:
				continue
			if e[i][j] == '#':
				continue
			if e[i + 1][j] == '#':
				continue
			if e[i + 2][j] == '#':
				continue
			if e[i + 1][j - 1] == '#':
				continue
			if e[i + 1][j + 1] == '#':
				continue
			e[i][j] = '#'
			e[i + 1][j] = '#'
			e[i + 2][j] = '#'
			e[i + 1][j - 1] = '#'
			e[i + 1][j + 1] = '#'
			aki -= 5
	if aki == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
b = [input() for i in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if b[i][j] == '.':
			if b[i - 1][j] == '.' and b[i][j - 1] == '.' and (b[i + 1][j] == '.') and (b[i][j + 1] == '.'):
				b[i - 1] = b[i - 1][:j] + '#' + b[i - 1][j + 1:]
				b[i] = b[i][:j - 1] + '###' + b[i][j + 2:]
				b[i + 1] = b[i + 1][:j] + '#' + b[i + 1][j + 1:]
for i in range(n):
	if '.' in b[i]:
		print('NO')
		exit()
print('YES')


def put(i, j):
	a[i + 1][j] = '#'
	a[i][j] = '#'
	a[i - 1][j] = '#'
	a[i][j + 1] = '#'
	a[i][j - 1] = '#'

def free(i, j):
	if a[i + 1][j] == '.' and a[i][j] == '.' and (a[i - 1][j] == '.') and (a[i][j + 1] == '.') and (a[i][j - 1] == '.'):
		return True
	else:
		return False
n = int(input())
a = []
for i in range(n):
	a.append([j for j in input()])
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if free(i, j):
			put(i, j)
f = True
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			f = False
			break
print('YES' if f else 'NO')


import sys
import collections as cc
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
a = []
te = 0
for i in range(n):
	t = list(input())
	te += t.count('#')
	a.append(t)
c = 0
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			x = i
			y = j
			if x - 1 >= 0 and x + 1 < n and (y - 1 >= 0) and (y + 1 < n):
				if a[x - 1][y] == '.' and a[x + 1][y] == '.' and (a[x][y + 1] == '.') and (a[x][y - 1] == '.'):
					a[x - 1][y] = '#'
					a[x + 1][y] = '#'
					a[x][y - 1] = '#'
					a[x][y + 1] = '#'
					a[x][y] = '#'
					c += 5
if c + te == n ** 2:
	print('YES')
else:
	print('NO')


n = int(input())
a = []
for _ in range(n):
	temp = list(map(str, input()))
	a.append(temp)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if a[i][j] == '.':
			if a[i + 1][j] == '.' and a[i - 1][j] == '.' and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
				a[i][j] = '#'
				a[i + 1][j] = '#'
				a[i - 1][j] = '#'
				a[i][j - 1] = '#'
				a[i][j + 1] = '#'
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			print('NO')
			exit()
print('YES')


n = int(input())
matrix = []
supposed_to_be_total = n * n
while n:
	s = input()
	matrix.append(list(s))
	n = n - 1
m = len(matrix)
i = 1
while i < m - 1:
	j = 1
	while j < m - 1:
		if matrix[i][j] == '#':
			count = 0
			j = j + 1
			continue
		else:
			if matrix[i + 1][j] == '.' and matrix[i - 1][j] == '.' and (matrix[i][j - 1] == '.') and (matrix[i][j + 1] == '.'):
				matrix[i + 1][j] = '#'
				matrix[i - 1][j] = '#'
				matrix[i][j - 1] = '#'
				matrix[i][j + 1] = '#'
				matrix[i][j] = '#'
			j = j + 1
	i = i + 1
for i in range(m):
	if '.' in matrix[i]:
		print('NO')
		exit(0)
print('YES')


def sol(board):
	for r in range(len(board)):
		for c in range(len(board[r])):
			if board[r][c] == '.':
				diff = [(0, 0), (1, 0), (2, 0), (1, -1), (1, 1)]
				for (dr, dc) in diff:
					if not (0 <= r + dr <= len(board) - 1 and 0 <= c + dc <= len(board[r + dr]) - 1 and (board[r + dr][c + dc] == '.')):
						return 'NO'
					board[r + dr][c + dc] = '#'
	return 'YES'
n = int(input())
board = []
for _ in range(n):
	board.append(list(input()))
print(sol(board))


a = int(input())
n = a
ans = []
for i in range(a):
	s = input()
	t = []
	for i in range(len(s)):
		t.append(s[i])
	ans.append(t)
flag = 0
for i in range(len(ans)):
	m = ans[i]
	for j in range(len(m)):
		if m[j] == '.':
			if j - 1 < 0 or j + 1 >= a or i + 2 >= n:
				flag = 1
				break
			elif ans[i + 1][j - 1] == ans[i + 1][j] == ans[i + 1][j + 1] == ans[i + 2][j] == '.':
				flag = 0
				ans[i + 1][j - 1] = ans[i][j] = ans[i + 1][j + 1] = ans[i + 2][j] = ans[i + 1][j] = '#'
			else:
				flag = 1
				break
	if flag == 1:
		print('NO')
		exit()
print('YES')


n = int(input())
s = []
for i in range(0, n):
	m = str(input())
	l = [m[x] for x in range(0, n)]
	s.append(l)
bBreak = False
for row in range(0, n):
	for col in range(0, n):
		if s[row][col] == '.':
			if (col - 1 >= 0 and col + 1 < n) and (row + 1 < n and row + 2 < n):
				if s[row][col] == '.' and s[row + 1][col] == '.' and (s[row + 2][col] == '.') and (s[row + 1][col + 1] == '.') and (s[row + 1][col - 1] == '.'):
					s[row][col] = '#'
					s[row + 1][col] = '#'
					s[row + 2][col] = '#'
					s[row + 1][col + 1] = '#'
					s[row + 1][col - 1] = '#'
				else:
					bBreak = True
					break
			else:
				bBreak = True
				break
	if bBreak == True:
		break
if bBreak == False:
	print('YES')
else:
	print('NO')


import sys, math, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from decimal import Decimal
from fractions import Fraction

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
INF = 10 ** 9
mod = 10 ** 9 + 7
n = int(data())
mat = [list(data()) for i in range(n)]
steps = [(0, 1), (0, -1), (1, 0), (-1, 0)]
for i in range(n):
	for j in range(n):
		if mat[i][j] == '.':
			cnt = 0
			for (a, b) in steps:
				if 0 <= i + a < n and 0 <= j + b < n and (mat[i + a][j + b] == '.'):
					cnt += 1
			if cnt == 4:
				for (a, b) in steps:
					mat[i + a][j + b] = '#'
				mat[i][j] = '#'
for i in range(n):
	for j in range(n):
		if mat[i][j] == '.':
			out('NO')
			exit()
out('YES')


n = int(input())

def isavail(coord, i, j):
	if i < 0 or j < 0:
		return False
	if i == n or j == n:
		return False
	return str(i) + ' ' + str(j) not in coord
a = []
coord = set()
for i in range(n):
	a.append(input())
	for j in range(len(a[i])):
		if a[i][j] == '#':
			coord.add(str(i) + ' ' + str(j))
for i in range(n):
	for j in range(n):
		if isavail(coord, i, j) and isavail(coord, i + 1, j) and isavail(coord, i - 1, j) and isavail(coord, i, j - 1) and isavail(coord, i, j + 1):
			coord.add(str(i) + ' ' + str(j))
			coord.add(str(i - 1) + ' ' + str(j))
			coord.add(str(i + 1) + ' ' + str(j))
			coord.add(str(i) + ' ' + str(j - 1))
			coord.add(str(i) + ' ' + str(j + 1))
if len(coord) == n * n:
	print('YES')
else:
	print('NO')


ii = lambda : int(input())
si = lambda : input()
n = ii()
r = [list(si()) for i in range(n)]
for i in range(n - 2):
	for j in range(1, n - 1):
		if r[i][j] == '.' and r[i + 2][j] == '.' and (r[i + 1][j] == '.') and (r[i + 1][j - 1] == '.') and (r[i + 1][j + 1] == '.'):
			r[i][j] = '#'
			r[i + 2][j] = '#'
			r[i + 1][j] = '#'
			r[i + 1][j - 1] = '#'
			r[i + 1][j + 1] = '#'
d = sum((i.count('.') for i in r))
print('YES' if d == 0 else 'NO')


def main():
	n = int(input())
	b = [list(input()) for j in range(n)]
	ans = 1
	for i in range(n):
		for j in range(n):
			if b[i][j] == '.':
				b[i][j] = '#'
				if 0 <= i + 1 < n and 0 <= j - 1 < n and (0 <= i + 2 < n) and (0 <= j + 1 < n):
					x = 0
					if b[i + 1][j] == '.':
						x += 1
						b[i + 1][j] = '#'
					if b[i + 1][j - 1] == '.':
						x += 1
						b[i + 1][j - 1] = '#'
					if b[i + 1][j + 1] == '.':
						x += 1
						b[i + 1][j + 1] = '#'
					if b[i + 2][j] == '.':
						x += 1
						b[i + 2][j] = '#'
					if x != 4:
						ans = 0
						break
				else:
					ans = 0
					break
	if ans == 1:
		print('YES')
	else:
		print('NO')
main()


n = int(input())
l = []
for i in range(n):
	inp = list(input())
	for j in range(n):
		if inp[j] == '.':
			l.append((i, j))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if (i, j) in l:
			if (i - 1, j) in l and (i + 1, j) in l and ((i, j - 1) in l) and ((i, j + 1) in l):
				l.remove((i, j))
				l.remove((i - 1, j))
				l.remove((i + 1, j))
				l.remove((i, j - 1))
				l.remove((i, j + 1))
if len(l) == 0:
	print('YES')
else:
	print('NO')


n = int(input())
table = []
for i in range(n):
	table.append([x for x in str(input())])
x = True
for i in range(n):
	if x == True:
		while True:
			try:
				dot = table[i].index('.')
				if dot == n - 1 or i > n - 3:
					print('NO')
					x = False
					break
				elif table[i + 1][dot - 1] == '#' or table[i + 1][dot] == '#' or table[i + 1][dot + 1] == '#' or (table[i + 2][dot] == '#'):
					print('NO')
					x = False
					break
				else:
					table[i][dot] = '#'
					table[i + 1][dot - 1:dot + 2] = ['#', '#', '#']
					table[i + 2][dot] = '#'
					continue
			except ValueError:
				break
if x == True:
	print('YES')


ans = True
n = int(input())
tile = []
for i in range(n):
	tile.append([x for x in input()])
tile.append(['#'] * n)
tile.append(['#'] * n)
for i in range(n):
	for j in range(n):
		if tile[i][j] == '.':
			if j == 0 or j == n - 1:
				ans = False
				break
			if tile[i + 1][j] == tile[i + 1][j - 1] == tile[i + 1][j + 1] == tile[i + 2][j] == '.':
				tile[i][j] = tile[i + 1][j] = tile[i + 1][j - 1] = tile[i + 1][j + 1] = tile[i + 2][j] = '#'
			else:
				ans = False
				break
		if ans == False:
			break
if ans:
	print('YES')
else:
	print('NO')


n = int(input().strip())
matrix = []
for i in range(n):
	matrix.append([])
	for letter in input().strip():
		matrix[i].append(letter)

def check_bound(i, j):
	return i >= 0 and i < n and (j >= 0) and (j < n) and (matrix[i][j] == '.')

def check(i, j):
	(a, b, c, d, e) = (False, False, False, False, False)
	if all([check_bound(i + 1, j), check_bound(i + 2, j), check_bound(i + 1, j + 1), check_bound(i + 1, j - 1)]):
		matrix[i][j] = '#'
		matrix[i + 1][j] = '#'
		matrix[i + 2][j] = '#'
		matrix[i + 1][j + 1] = '#'
		matrix[i + 1][j - 1] = '#'
		a = True
	elif all([check_bound(i + 1, j), check_bound(i - 1, j), check_bound(i, j + 1), check_bound(i, j - 1)]):
		matrix[i][j] = '#'
		matrix[i + 1][j] = '#'
		matrix[i - 1][j] = '#'
		matrix[i][j + 1] = '#'
		matrix[i][j - 1] = '#'
		b = True
	elif all([check_bound(i - 1, j), check_bound(i - 2, j), check_bound(i - 1, j + 1), check_bound(i - 1, j - 1)]):
		matrix[i][j] = '#'
		matrix[i - 1][j] = '#'
		matrix[i - 2][j] = '#'
		matrix[i - 1][j + 1] = '#'
		matrix[i - 1][j - 1] = '#'
		c = True
	elif all([check_bound(i, j - 1), check_bound(i, j - 2), check_bound(i - 1, j - 1), check_bound(i + 1, j - 1)]):
		matrix[i][j] = '#'
		matrix[i][j - 1] = '#'
		matrix[i][j - 2] = '#'
		matrix[i - 1][j - 1] = '#'
		matrix[i + 1][j - 1] = '#'
		d = True
	elif all([check_bound(i, j + 1), check_bound(i, j + 2), check_bound(i - 1, j + 1), check_bound(i + 1, j + 1)]):
		matrix[i][j] = '#'
		matrix[i][j + 1] = '#'
		matrix[i][j + 2] = '#'
		matrix[i - 1][j + 1] = '#'
		matrix[i + 1][j + 1] = '#'
		e = True
	return any([a, b, c, d, e])
for i in range(n):
	for j in range(n):
		if matrix[i][j] == '.':
			check(i, j)
has = True
for i in range(n):
	for j in range(n):
		if matrix[i][j] == '.':
			has = False
			break
if has:
	print('YES')
else:
	print('NO')


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor
from bisect import bisect_right, bisect_left, bisect
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 9 + 7
LOGN = 30
T = 1
for _ in range(T):
	n = int(stdin.readline())
	N = n
	a = []
	while N > 0:
		t = list(stdin.readline().strip('\n'))
		a.append(t)
		N -= 1
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if a[i][j] == '.' and a[i - 1][j] == '.' and (a[i + 1][j] == '.') and (a[i][j - 1] == '.') and (a[i][j + 1] == '.'):
				a[i][j] = '#'
				a[i - 1][j] = '#'
				a[i + 1][j] = '#'
				a[i][j + 1] = '#'
				a[i][j - 1] = '#'
	isOk = True
	for i in range(n):
		for j in range(n):
			if a[i][j] == '.':
				isOk = False
				break
		if not isOk:
			break
	if isOk:
		print('YES')
	else:
		print('NO')


import math
read = lambda : map(int, input().split())

def codeforce1150B():
	p = []
	n = int(input())
	for _ in range(n):
		p.append(list(input()))
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if p[i][j] == p[i + 1][j] == p[i - 1][j] == p[i][j + 1] == p[i][j - 1] == '.':
				p[i][j] = p[i + 1][j] = p[i - 1][j] = p[i][j + 1] = p[i][j - 1] = '#'
	for i in range(n):
		for j in range(n):
			if p[i][j] == '.':
				print('NO')
				exit(0)
	print('YES')
codeforce1150B()


a = int(input())
b = []
f = 0
for i in range(a):
	x = list(input())
	b += [x]
co = 0
for i in b:
	co += i.count('.')
if co % 5 != 0:
	f = 1
else:
	for i in range(1, len(b) - 1):
		for j in range(1, len(b[i]) - 1):
			if b[i][j] == '.':
				if b[i][j - 1] == b[i][j + 1] == '.':
					if b[i - 1][j] == b[i + 1][j] == '.':
						b[i][j] = b[i][j - 1] = b[i][j + 1] = b[i - 1][j] = b[i + 1][j] = '#'
	co1 = 0
	for i in b:
		co1 += i.count('.')
	if co1 != 0:
		f = 1
print('NO') if f == 1 else print('YES')


n = int(input())
board = [list(input()) for _ in range(n)]

def get_pos(x, y):
	return board[y][x]
sides = ((-1, 0), (1, 0), (0, 1), (0, -1))
diagonal = ((-1, -1), (1, 1), (-1, 1), (1, -1))
picks = ((0, 2), (2, 0), (-2, 0), (0, -2))
data = {(i, j): [] for i in range(1, n - 1) for j in range(1, n - 1) if get_pos(i, j) == '.'}
for dot in list(data.keys()):
	siders = [(dot[0] + s[0], dot[1] + s[1]) for s in sides]
	for pos in siders:
		if get_pos(*pos) == '#':
			data.pop(dot, None)
			break
	else:
		diagonalers = [(dot[0] + s[0], dot[1] + s[1]) for s in diagonal]
		data[dot] = (diagonalers, siders)
while data:
	(pos, (diagonalers, siders)) = sorted(data.items(), key=lambda x: [get_pos(*i) for i in x[1][0]].count('#'), reverse=True)[0]
	if [get_pos(*d) for d in diagonalers].count('#') <= 1:
		break
	board[pos[1]][pos[0]] = '#'
	data.pop(pos, None)
	for p in siders:
		board[p[1]][p[0]] = '#'
		data.pop(p, None)
	for p in diagonalers:
		data.pop(p, None)
	for p in [(pos[0] + x, pos[1] + y) for (x, y) in picks]:
		data.pop(p, None)
for row in board:
	if row.count('.') != 0:
		print('NO')
		break
else:
	print('YES')


def solve(a):
	c = 0
	for i in a:
		s = i.count('.')
		c += s
	return c
n = int(input())
a = [list(input()) for _ in range(n)]
s = 0
l2 = solve(a)
for i in range(n - 2):
	for j in range(n - 1):
		if a[i][j] == '.' and a[i + 1][j - 1] == '.' and (a[i + 1][j] == '.') and (a[i + 1][j + 1] == '.') and (a[i + 2][j] == '.'):
			s += 1
			a[i][j] = a[i + 1][j - 1] = a[i + 1][j] = a[i + 1][j + 1] = a[i + 2][j] = '#'
if l2 - s * 5 == 0:
	print('YES')
else:
	print('NO')


n = int(input())
m = []
for i in range(n):
	x = list(input())
	m.append(x)
for i in range(n):
	for j in range(n):
		if i >= n or i < 0 or j >= n or (j < 0):
			continue
		if m[i][j] == '.':
			if i - 1 >= 0 and j - 1 >= 0 and (i + 1 < n) and (j + 1 < n):
				if m[i - 1][j] == '.' and m[i + 1][j] == '.' and (m[i][j - 1] == '.') and (m[i][j + 1] == '.') or (m[i - 1][j] == 'x' and m[i + 1][j] == 'x' and (m[i][j - 1] == 'x') and (m[i][j + 1] == 'x')):
					m[i - 1][j] = m[i][j] = m[i + 1][j] = m[i][j - 1] = m[i][j + 1] = 'x'
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			print('NO')
			exit()
print('YES')


t = int(input())
l1 = []
for x in range(t):
	l1.append(list(input()))
for x in range(1, t - 1):
	for y in range(1, t - 1):
		done = 0
		if l1[x][y] != '.':
			done = 1
		if not done and l1[x][y - 1] != '.':
			done = 1
		if not done and l1[x][y + 1] != '.':
			done = 1
		if not done and l1[x - 1][y] != '.':
			done = 1
		if not done and l1[x + 1][y] != '.':
			done = 1
		if not done:
			l1[x][y] = '#'
			l1[x - 1][y] = '#'
			l1[x][y - 1] = '#'
			l1[x + 1][y] = '#'
			l1[x][y + 1] = '#'
ruined = 0
for x in l1:
	if '.' in x:
		print('NO')
		ruined = 1
		break
if not ruined:
	print('YES')


def main():
	from sys import stdin, stdout

	def read():
		return stdin.readline().rstrip('\n')

	def read_array(sep=None, maxsplit=-1):
		return read().split(sep, maxsplit)

	def read_int():
		return int(read())

	def read_int_array(sep=None, maxsplit=-1):
		return [int(a) for a in read_array(sep, maxsplit)]

	def write(*args, **kwargs):
		sep = kwargs.get('sep', ' ')
		end = kwargs.get('end', '\n')
		stdout.write(sep.join((str(a) for a in args)) + end)

	def write_array(array, **kwargs):
		sep = kwargs.get('sep', ' ')
		end = kwargs.get('end', '\n')
		stdout.write(sep.join((str(a) for a in array)) + end)

	def neighbors(i, j):
		yield (i - 1, j)
		yield (i, j - 1)
		yield (i, j)
		yield (i, j + 1)
		yield (i + 1, j)
	n = read_int()
	lines = [list(line) for line in stdin.read().split('\n')]
	for i in range(1, n - 1):
		for j in range(1, n - 1):
			if all((lines[r][c] == '.' for (r, c) in neighbors(i, j))):
				for (r, c) in neighbors(i, j):
					lines[r][c] = '#'
	write('NO' if any((ch == '.' for row in lines for ch in row)) else 'YES')
main()


n = int(input().strip())
grid = [list(input().strip()) for _ in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if grid[i][j] == '.' and grid[i][j + 1] == '.' and (grid[i][j - 1] == '.') and (grid[i + 1][j] == '.') and (grid[i - 1][j] == '.'):
			grid[i][j] = '#'
			grid[i][j + 1] = '#'
			grid[i][j - 1] = '#'
			grid[i + 1][j] = '#'
			grid[i - 1][j] = '#'
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			print('NO')
			quit()
print('YES')


n = int(input())
t = []
for i in range(n):
	t.append([0 if z == '#' else 1 for z in input()])
for r in range(n - 2):
	for c in range(n - 2):
		r1 = t[r][c:c + 3]
		r2 = t[r + 1][c:c + 3]
		r3 = t[r + 2][c:c + 3]
		if r1 == [0, 1, 0] and r2 == [1, 1, 1] and (r3[1] == 1):
			t[r][c + 1] = 0
			t[r + 1][c:c + 3] = [0, 0, 0]
			t[r + 2][c + 1] = 0
so = [tr.count(1) for tr in t]
print('YES' if sum(so) == 0 else 'NO')


n = int(input())
mat = []
for i in range(n):
	mat.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if mat[i][j] == '.':
			if mat[i + 1][j] == '.' and mat[i - 1][j] == '.' and (mat[i][j - 1] == '.') and (mat[i][j + 1] == '.'):
				mat[i + 1][j] = '#'
				mat[i - 1][j] = '#'
				mat[i][j - 1] = '#'
				mat[i][j + 1] = '#'
				mat[i][j] = '#'
cnt = 0
for i in range(n):
	for j in range(n):
		if mat[i][j] == '#':
			cnt += 1
print('YES' if cnt == n * n else 'NO')


from sys import stdin, stdout

def valid(i, j):
	return 0 <= i < n and 0 <= j < n

def fn(x, y):
	for (xx, yy) in ([1, 0], [-1, 0], [0, 1], [0, -1]):
		if valid(x + xx, y + yy) and a[x + xx][y + yy] == '.':
			continue
		else:
			return
	a[x][y] = '#'
	for (xx, yy) in ([1, 0], [-1, 0], [0, 1], [0, -1]):
		a[x + xx][y + yy] = '#'
for _ in range(1):
	n = int(stdin.readline())
	a = [list(input()) for _ in range(n)]
	f = 1
	for i in range(n):
		for j in range(n):
			if a[i][j] == '.':
				fn(i, j)
	for i in range(n):
		for j in range(n):
			if a[i][j] == '.':
				f = 0
				break
	print('YES' if f else 'NO')


n = int(input())
board = [list(input()) for _ in range(n)]

def f(i, j):
	if j == 0 or j == n - 1:
		return False
	if i >= n - 2:
		return False
	if '#' in (board[i + 1][j - 1], board[i + 1][j], board[i + 1][j + 1], board[i + 2][j]):
		return False
	return True

def g(i, j):
	board[i][j] = '#'
	board[i + 1][j - 1] = '#'
	board[i + 1][j] = '#'
	board[i + 1][j + 1] = '#'
	board[i + 2][j] = '#'
for i in range(n):
	for j in range(n):
		if board[i][j] == '.':
			if not f(i, j):
				print('NO')
				exit()
			g(i, j)
print('YES')


kk = lambda : map(int, input().split())
ll = lambda : list(kk())

def check(i, j):
	if 0 <= i < n and 0 <= j < n:
		if ls[i][j] == 0:
			ls[i][j] = 1
			return True
	return False
n = int(input())
ls = [None] * n
for i in range(n):
	ls[i] = [1 if i == '#' else 0 for i in input()]
for i in range(n):
	for j in range(n):
		if ls[i][j] == 1:
			continue
		if check(i, j) and check(i + 1, j) and check(i + 2, j) and check(i + 1, j + 1) and check(i + 1, j - 1):
			pass
		else:
			print('NO')
			exit()
print('YES')


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
S = ord('#')

def solve(N, A):
	for y in range(N):
		for x in range(N):
			if A[y][x] == S:
				continue
			if x == 0 or x == N - 1:
				return False
			if y + 2 >= N:
				return False
			if A[y + 1][x - 1] == S or A[y + 1][x] == S or A[y + 1][x + 1] == S or (A[y + 2][x] == S):
				return False
			A[y][x] = S
			A[y + 1][x - 1] = S
			A[y + 1][x] = S
			A[y + 1][x + 1] = S
			A[y + 2][x] = S
	return True

def main():
	N = int(inp())
	A = [bytearray(inp(), 'US-ASCII') for _ in range(N)]
	print('YES' if solve(N, A) else 'NO')
main()


cross = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]

def fill_board(board, n):
	for row in range(1, n + 1):
		for col in range(1, n + 1):
			if board[row][col] == '.':
				for i in range(1, 5):
					if board[row + cross[i][0]][col + cross[i][1]] == '#':
						return False
					else:
						board[row + cross[i][0]][col + cross[i][1]] = '#'
	return True
n = int(input())
board = [['#'] * (n + 2)]
for _ in range(n):
	board.append(list('#' + input() + '#'))
board.append(['#'] * (n + 2))
print(('NO', 'YES')[fill_board(board, n)])


n = int(input())
l = ['a'] * n
for i in range(n):
	l[i] = list(input())

def check():
	for i in range(n - 2):
		if l[i].count('.') == 0:
			continue
		if l[i].index('.') == 0 or l[i].index('.') == n - 1:
			return 0
		elif l[i].count('.'):
			a = l[i].index('.')
			if l[i + 1][a - 1] == '.' and l[i + 1][a] == '.' and (l[i + 1][a + 1] == '.') and (l[i + 2][a] == '.'):
				l[i][a] = '#'
				l[i + 2][a] = '#'
				l[i + 1][a] = '#'
				l[i + 1][a - 1] = '#'
				l[i + 1][a + 1] = '#'
				return 1
			else:
				return 0
	return 1
for i in range(502):
	b = check()
	if not b:
		print('NO')
		exit()
if l[n - 1].count('.') or l[n - 2].count('.'):
	print('NO')
	exit()
print('YES')


n = int(input())
m = []
for i in range(n):
	m.append([i for i in input()])
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			found = False
			if j + 2 < n and i - 1 > -1 and (i + 1 < n):
				if m[i][j + 1] == '.' and m[i][j + 2] == '.' and (m[i - 1][j + 1] == '.') and (m[i + 1][j + 1] == '.'):
					m[i][j] = '#'
					m[i][j + 1] = '#'
					m[i][j + 2] = '#'
					m[i - 1][j + 1] = '#'
					m[i + 1][j + 1] = '#'
					found = True
			if i + 2 < n and j - 1 > -1 and (j + 1 < n):
				if m[i + 1][j] == '.' and m[i + 2][j] == '.' and (m[i + 1][j - 1] == '.') and (m[i + 1][j + 1] == '.'):
					m[i][j] = '#'
					m[i + 1][j] = '#'
					m[i + 2][j] = '#'
					m[i + 1][j - 1] = '#'
					m[i + 1][j + 1] = '#'
					found = True
			if not found:
				print('NO')
				exit()
print('YES')


n = int(input())
arr = []
for _ in range(n):
	arr.append(list(input()))
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			if i + 2 < n and j > 0 and (j < n - 1) and (arr[i + 1][j - 1] == arr[i + 1][j] == arr[i + 1][j + 1] == arr[i + 2][j] == '.'):
				arr[i + 1][j - 1] = arr[i + 1][j] = arr[i + 1][j + 1] = arr[i + 2][j] = arr[i][j] = '#'
			else:
				print('NO')
				exit()
print('YES')


n = int(input())
a = []
for i in range(n):
	a.append([j for j in input()])
b = 0
for y in range(n):
	for x in range(n):
		if a[y][x] == '.':
			try:
				ms = [a[y + 1][x - 1], a[y + 1][x], a[y + 1][x + 1], a[y + 2][x]]
				for t in ms:
					if t != '.':
						raise Exception
				(a[y][x], a[y + 1][x - 1], a[y + 1][x], a[y + 1][x + 1], a[y + 2][x]) = ('#', '#', '#', '#', '#')
			except:
				b = 1
				break
if b:
	print('NO')
else:
	print('YES')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
for j in range(n):
	for k in range(n):
		try:
			if a[j][k] == '.' and a[j + 1][k - 1] == '.' and (a[j + 1][k] == '.') and (a[j + 1][k + 1] == '.') and (a[j + 2][k] == '.'):
				a[j][k] = '#'
				a[j + 1][k - 1] = '#'
				a[j + 1][k] = '#'
				a[j + 1][k + 1] = '#'
				a[j + 2][k] = '#'
		except IndexError:
			pass
cnt = 0
for p in range(n):
	for m in range(n):
		if a[p][m] == '.':
			cnt += 1
if cnt == 0:
	print('YES')
else:
	print('NO')


import sys
px = [-1, 0, 0, 1]
py = [0, -1, 1, 0]

def check(x, y):
	global map_, n
	checker = 0
	for i in range(4):
		nx = x + px[i]
		ny = y + py[i]
		if (0 <= ny and ny <= n - 1) and (0 <= nx and nx <= n - 1):
			if map_[ny][nx] == '.':
				checker += 1
	if checker == 4:
		map_[y][x] = '#'
		for i in range(4):
			nx = x + px[i]
			ny = y + py[i]
			map_[ny][nx] = '#'
input = sys.stdin.readline
n = int(input())
map_ = [list(input().rstrip()) for _ in range(n)]
ans = True
for i in range(n):
	for j in range(n):
		if map_[i][j] == '.':
			check(j, i)
for i in map_:
	if '.' in i:
		ans = False
if ans:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
c = c2 = 0
for i in range(n):
	s = input()
	c2 += s.count('.')
	l.append(list(s))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l[i][j] == l[i + 1][j] == l[i - 1][j] == l[i][j - 1] == l[i][j + 1] == '.':
			c += 5
			l[i][j] = l[i + 1][j] = l[i - 1][j] = l[i][j - 1] = l[i][j + 1] = '1'
if c2 == c:
	print('YES')
else:
	print('NO')


n = int(input())
s = [['#' for i in range(n + 4)] for j in range(n + 4)]
for i in range(2, n + 2):
	s[i][2:-2] = list(input().strip())

def check():
	for i in range(2, n + 2):
		for j in range(2, n + 2):
			if s[i][j] == '.':
				s[i][j] = '#'
				for k in range(j - 1, j + 2):
					if s[i + 1][k] == '#':
						return 'NO'
					else:
						s[i + 1][k] = '#'
				if s[i + 2][j] == '#':
					return 'NO'
				else:
					s[i + 2][j] = '#'
	return 'YES'
print(check())


r = lambda : [*map(int, input().split())]

def c(e, b):
	if a[e - 1][b] == '.' and a[e + 1][b] == '.' and (a[e][b + 1] == '.') and (a[e][b - 1] == '.'):
		return True
	else:
		return False
n = int(input())
f = True
a = []
b = 0
for i in range(n):
	g = [*input()]
	a.append(g)
	b += a[i].count('.')
b /= 5
b1 = 0
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if c(i, j):
			b1 += 1
			a[i][j] = '0'
			a[i - 1][j] = '0'
			a[i + 1][j] = '0'
			a[i][j + 1] = '0'
			a[i][j - 1] = '0'
for i in a:
	if '.' in i:
		f = False
		break
if b1 == b and f:
	print('YES')
else:
	print('NO')


def check(b, i, j):
	legal = True
	if b[i - 1][j] == '#':
		legal = False
	if b[i + 1][j] == '#':
		legal = False
	if b[i][j - 1] == '#':
		legal = False
	if b[i][j + 1] == '#':
		legal = False
	return legal
n = int(input())
b = [['.' for i in range(n)] for j in range(n)]
for i in range(n):
	b[i] = list(input())
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if b[i][j] == '.':
			if check(b, i, j):
				b[i][j - 1] = '#'
				b[i][j + 1] = '#'
				b[i - 1][j] = '#'
				b[i + 1][j] = '#'
				b[i][j] = '#'
legal = True
for i in range(n):
	for j in range(n):
		if b[i][j] == '.':
			legal = False
			break
if legal:
	print('YES')
else:
	print('NO')


n = int(input())
g = [[True for _ in range(n + 2)]]
for _ in range(n):
	row = [True]
	for x in input():
		if x == '.':
			row.append(False)
		else:
			row.append(True)
	row.append(True)
	g.append(row)
g.append([True for _ in range(n + 2)])

def in_range(node):
	(r, c) = node
	if r < 0 or c < 0:
		return False
	if r > n + 2 or c > n + 2:
		return False
	return True

def get_nodes(r, c, d):
	if d == 0:
		return [(r + 1, c), (r + 1, c + 1), (r + 1, c - 1), (r + 2, c)]
	if d == 1:
		return [(r - 1, c), (r - 1, c + 1), (r - 1, c - 1), (r - 2, c)]
	if d == 2:
		return [(r, c + 1), (r - 1, c + 1), (r + 1, c + 1), (r, c + 2)]
	if d == 3:
		return [(r, c - 1), (r - 1, c - 1), (r + 1, c - 1), (r, c - 2)]

def solve(leftup, w):
	if w <= 0:
		return True
	(r0, c0) = leftup
	for (r, d) in [(r0, 0), (r0 + w - 1, 1)]:
		for c in range(c0, c0 + w):
			if g[r][c]:
				continue
			nodes = get_nodes(r, c, d)
			for node in nodes:
				if not in_range(node):
					return False
				(nr, nc) = node
				if g[nr][nc]:
					return False
				g[nr][nc] = True
			g[r][c] = True
	for (c, d) in [(c0, 2), (c0 + w - 1, 3)]:
		for r in range(r0, r0 + w):
			if g[r][c]:
				continue
			nodes = get_nodes(r, c, d)
			for node in nodes:
				if not in_range(node):
					return False
				(nr, nc) = node
				if g[nr][nc]:
					return False
				g[nr][nc] = True
			g[r][c] = True
	return solve((r0 + 1, c0 + 1), w - 2)

def pg():
	print('grid:')
	for row in g:
		print(''.join(map(lambda x: '#' if x else '.', row)))
	print()
if solve((1, 1), n):
	print('YES')
else:
	print('NO')


n = int(input())
lst = []
mat = [0] * 100

def valid(i, j):
	if i - 1 >= 0 and j - 1 >= 0 and (i + 1 < n) and (j + 1 < n):
		if lst[i][j] == '.' and lst[i - 1][j] == '.' and (lst[i + 1][j] == '.') and (lst[i][j - 1] == '.') and (lst[i][j + 1] == '.'):
			return True
	return False
for i in range(n):
	st = str(input())
	t = []
	for j in range(len(st)):
		t.append(st[j])
	lst.append(t)
for i in range(n):
	for j in range(n):
		if valid(i, j) == 1:
			(r, c) = (i, j)
			lst[r][c] = '#'
			lst[r + 1][c] = '#'
			lst[r - 1][c] = '#'
			lst[r][c + 1] = '#'
			lst[r][c - 1] = '#'
b = 0
for i in range(n):
	for j in range(n):
		if lst[i][j] == '.':
			b = 1
if b:
	print('NO')
else:
	print('YES')


n = int(input())
grid = [list(input().strip()) for _ in range(n)]

def is_possible(i, j):
	if not (0 < i < n - 1 and 0 < j < n - 1):
		return False
	return grid[i][j] == grid[i][j + 1] == grid[i + 1][j] == grid[i][j - 1] == grid[i - 1][j] == '.'

def put(i, j, symbol):
	if not (0 < i < n - 1 and 0 < j < n - 1):
		return
	grid[i][j] = grid[i][j + 1] = grid[i + 1][j] = grid[i][j - 1] = grid[i - 1][j] = symbol
for i in range(n):
	for j in range(n):
		if grid[i][j] == '.':
			if is_possible(i + 1, j):
				put(i + 1, j, '#')
			else:
				print('NO')
				exit()
print('YES')


import collections
n = int(input())
a = [list((ch for ch in input())) for i in range(n)]
for i in range(n - 2):
	for j in range(n - 2):
		if a[i][j] == '#':
			if all((a[I][J] == '.' for (I, J) in ((i, j + 1), (i + 1, j), (i + 1, j + 1), (i + 1, j + 2), (i + 2, j + 1)))):
				for (I, J) in ((i, j + 1), (i + 1, j), (i + 1, j + 1), (i + 1, j + 2), (i + 2, j + 1)):
					a[I][J] = '#'
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			exit(print('NO'))
print('YES')


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
lens = RI()
grid = [[x for x in input()] for _ in range(lens)]
for i in range(1, lens - 1):
	for j in range(1, lens - 1):
		if grid[i][j] == '.':
			if grid[i - 1][j] == grid[i + 1][j] == grid[i][j - 1] == grid[i][j + 1] == '.':
				grid[i][j] = '1'
				grid[i + 1][j] = '1'
				grid[i - 1][j] = '1'
				grid[i][j + 1] = '1'
				grid[i][j - 1] = '1'
ans = 'YES'
for i in range(lens):
	for j in range(lens):
		if grid[i][j] == '.':
			ans = 'NO'
			break
	if ans == 'NO':
		break
print(ans)


n = int(input())
a = []
c = [list(str(input())) for i in range(n)]
for i in range(n):
	indexes = [j for (j, s) in enumerate(c[i]) if s == '.']
	for j in range(len(indexes)):
		if i != n - 1:
			indexes1 = [k for (k, s) in enumerate(c[i + 1]) if s == '.']
			if len(indexes1) != 0:
				ind1 = [k for k in indexes1 if k == indexes[j] - 1]
				for l in range(len(ind1)):
					if i != n - 2 and ind1[l] + 1 < n and (ind1[l] + 2 < n) and (c[i + 1][ind1[l] + 1] == '.') and (c[i + 1][ind1[l] + 2] == '.'):
						indexes2 = [k for (k, s) in enumerate(c[i + 2]) if s == '.']
						if len(indexes2) != 0:
							ind2 = [k for k in indexes2 if k == indexes[j]]
							for y in range(len(ind2)):
								if ind2[y] == indexes[j]:
									c[i][indexes[j]] = '#'
									c[i + 1][ind1[l]] = '#'
									c[i + 1][ind1[l] + 1] = '#'
									c[i + 1][ind1[l] + 2] = '#'
									c[i + 2][ind2[y]] = '#'
									s = ''
									s1 = ''
									s2 = ''
count = 0
for i in range(n):
	indexes = [j for (j, s) in enumerate(c[i]) if s == '.']
	if len(indexes) == 0:
		count = count + 1
if count == n:
	print('YES')
else:
	print('NO')


def main():
	n = int(input())
	field = [list(input()) for _ in range(n)]
	for y in range(n):
		for x in range(n):
			if field[y][x] == '.':
				if y > n - 3 or x == 0 or x == n - 1 or (field[y + 1][x - 1] == '#') or (field[y + 1][x] == '#') or (field[y + 1][x + 1] == '#') or (field[y + 2][x] == '#'):
					print('NO')
					return
				field[y][x] = '#'
				field[y + 1][x - 1] = '#'
				field[y + 1][x] = '#'
				field[y + 1][x + 1] = '#'
				field[y + 2][x] = '#'
	print('YES')
	return
main()


from sys import exit
N = int(input())
G = [list(input()) for _ in range(N)]
for i in range(N):
	for j in range(N):
		if G[i][j] == '.':
			if not 1 <= j <= N - 2 or not i <= N - 3:
				print('NO')
				exit()
			for (a, b) in [(i, j), (i + 1, j - 1), (i + 1, j), (i + 1, j + 1), (i + 2, j)]:
				if G[a][b] == '#':
					print('NO')
					exit()
				G[a][b] = '#'
print('YES')


n = int(input())
matrix = [list(input()) for _ in range(n)]
transform = [[0, 0], [1, 0], [-1, 0], [0, -1], [0, 1]]
for row in range(1, n - 1):
	for column in range(1, n - 1):
		if matrix[row][column] == '.':
			rr = 0
			for tr in transform:
				if matrix[row + tr[0]][column + tr[1]] == '.':
					rr += 1
			if rr == 5:
				for tr in transform:
					matrix[row + tr[0]][column + tr[1]] = '#'
result = all([True if ['#'] * n == e else False for e in matrix])
if result == True:
	print('YES')
else:
	print('NO')


from sys import *
from math import *
n = int(stdin.readline())
m = []
for i in range(n):
	a = list(input())
	m.append(a)
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if m[i][j] == '.' and m[i - 1][j] == '.' and (m[i + 1][j] == '.') and (m[i][j - 1] == '.') and (m[i][j + 1] == '.'):
			m[i][j] = '#'
			m[i - 1][j] = '#'
			m[i + 1][j] = '#'
			m[i][j - 1] = '#'
			m[i][j + 1] = '#'
f = 0
for i in range(n):
	for j in range(n):
		if m[i][j] == '.':
			f = 1
			break
if f == 1:
	print('NO')
else:
	print('YES')


s = int(input())
a = [[x for x in input()] for _ in range(s)]
key = True
for (i, line) in enumerate(a[:-2]):
	for (j, sym) in enumerate(line[:-2]):
		if line[j + 1] == '.':
			if a[i + 1][j] == '.' and a[i + 1][j + 1] == '.' and (a[i + 1][j + 2] == '.') and (a[i + 2][j + 1] == '.'):
				a[i][j + 1] = '#'
				a[i + 1][j] = '#'
				a[i + 1][j + 1] = '#'
				a[i + 1][j + 2] = '#'
				a[i + 2][j + 1] = '#'
			else:
				key = False
				print('NO')
				break
	if not key:
		break
if key:
	for i in a:
		for x in i:
			if x == '.':
				print('NO')
				key = False
				break
		if not key:
			break
if key:
	print('YES')


n = int(input())
s = []
for i in range(n):
	s.append(list(input()))
ok = True
for i in range(n - 2):
	for j in range(n - 1):
		if s[i][j] == '.':
			for (x, y) in ((0, 0), (-1, 1), (0, 1), (1, 1), (0, 2)):
				if s[i + y][j + x] == '.':
					s[i + y][j + x] = '#'
				else:
					ok = False
for i in range(n):
	if s[i].count('.'):
		ok = False
print('YES' if ok else 'NO')


import sys
n = int(input())
l = [[1 if j == '.' else 0 for j in input()] for i in range(n)]
p = True
for y in range(n):
	for x in range(n):
		if l[y][x]:
			if 1 <= x <= n - 2 and y <= n - 3:
				if l[y + 1][x] and l[y + 2][x] and l[y + 1][x - 1] and l[y + 1][x + 1]:
					l[y][x] = 0
					l[y + 1][x] = 0
					l[y + 2][x] = 0
					l[y + 1][x - 1] = 0
					l[y + 1][x + 1] = 0
				else:
					print('NO')
					sys.exit(0)
			else:
				print('NO')
				sys.exit(0)
print('YES')


n = int(input())
arr = []
for i in range(n):
	arr.append(list(input()))
for i in range(n - 2):
	for j in range(n - 2):
		if arr[i][j] == '#' and arr[i + 1][j] == arr[i][j + 1] == arr[i + 1][j + 1] == '.':
			if arr[i + 2][j + 1] == '#' or arr[i + 1][j + 2] == '#':
				print('NO')
				exit()
			arr[i + 1][j] = arr[i][j + 1] = arr[i + 1][j + 1] = arr[i + 2][j + 1] = arr[i + 1][j + 2] = '#'
for i in range(n):
	for j in range(n):
		if arr[i][j] == '.':
			print('NO')
			exit()
print('YES')


import datetime
n = int(input())
arr = []
for i in range(n):
	arr.append(list(input()))
if arr[0][0] == '.':
	print('NO')
else:
	answer = True
	for i in range(n):
		flag = 1
		for j in range(n):
			if arr[i][j] == '.':
				if i + 2 + 1 <= n and j + 1 + 1 <= n and (j - 1 + 1 >= 0):
					if arr[i + 1][j - 1] == arr[i + 1][j] == arr[i + 1][j + 1] == arr[i + 1 + 1][j] == '.':
						arr[i + 1][j - 1] = '#'
						arr[i + 1][j] = '#'
						arr[i + 1][j + 1] = '#'
						arr[i + 1 + 1][j] = '#'
						arr[i][j] = '#'
					else:
						answer = False
						flag = 0
				else:
					answer = False
					flag = 0
		if flag == 0:
			break
	if answer:
		print('YES')
	else:
		print('NO')


n = int(input())
l1 = []
for i in range(n):
	s = input()
	l1.append(list(s))
flag = 0
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if l1[i][j] == '.':
			if l1[i - 1][j] == '.' and l1[i + 1][j] == '.' and (l1[i][j - 1] == '.') and (l1[i][j + 1] == '.'):
				l1[i][j] = '#'
				l1[i - 1][j] = '#'
				l1[i + 1][j] = '#'
				l1[i][j - 1] = '#'
				l1[i][j + 1] = '#'
x = 0
for item in l1:
	x += item.count('#')
if x != n ** 2:
	print('NO')
else:
	print('YES')


n = int(input())
lines = [list(input()) for _ in range(n)]

def umeru(umeru_info, line):
	out_umeru_info = []
	ok = True
	for (line_i, cell_i, count) in umeru_info:
		if count == 1:
			if line[cell_i - 1] == '.' and line[cell_i] == '.' and (line[cell_i + 1] == '.'):
				line[cell_i - 1] = '#'
				line[cell_i] = '#'
				line[cell_i + 1] = '#'
				out_umeru_info.append([line_i, cell_i, 2])
			else:
				ok = False
				return (ok, None, None)
		elif line[cell_i] == '.':
			line[cell_i] = '#'
		else:
			ok = False
			return (ok, None, None)
	return (ok, out_umeru_info, line)

def find_first(line_i, line, umeru_info, n):
	ok = True
	for (cell_i, cell) in enumerate(line):
		if cell == '.':
			if cell_i in [0, n - 1] or line_i in [n - 2, n - 1]:
				ok = False
				return (ok, None)
			else:
				umeru_info.append([line_i, cell_i, 1])
	return (ok, umeru_info)
umeru_info = []
fail = False
for (line_i, line) in enumerate(lines):
	(ok, umeru_info, line) = umeru(umeru_info, line)
	if not ok:
		fail = True
		break
	(ok, umeru_info) = find_first(line_i, line, umeru_info, n)
	if not ok:
		fail = True
		break
out = 'NO' if fail else 'YES'
print(out)


def lim(i, j, m):
	if (i >= 0 and i < n) and (j >= 0 and j < n) and (m[i][j] == 1):
		return True
	return False
x = [0, 0, 0, -1, 1]
y = [2, 1, 0, 1, 1]
n = int(input())
bd = [0] * n
for i in range(n):
	st = input()
	bd[i] = [0] * n
	for j in range(n):
		if st[j] == '.':
			bd[i][j] = 1
fld = True
for i in range(n):
	for j in range(n):
		if bd[i][j] == 1:
			for k in range(5):
				o = i + y[k]
				a = j + x[k]
				if lim(o, a, bd):
					bd[o][a] = 0
				else:
					fld = False
					break
if fld:
	print('YES')
else:
	print('NO')


n = int(input())
l = []
F = 0
for i in range(0, n):
	p = input().rstrip()
	x = list(p)
	l.append(x)
for i in range(0, len(l)):
	for j in range(0, len(l[i])):
		if l[i][j] == '.':
			if i + 2 < len(l) and l[i + 1][j] == '.' and (l[i + 2][j] == '.') and (j - 1 >= 0) and (j + 1 < len(l[i])) and (l[i + 1][j - 1] == '.') and (l[i + 1][j + 1] == '.'):
				l[i + 1][j] = '#'
				l[i + 2][j] = '#'
				l[i + 1][j - 1] = '#'
				l[i + 1][j + 1] = '#'
			else:
				F = 1
				break
	if F == 1:
		break
if F == 0:
	print('YES')
else:
	print('NO')


n = int(input())
f = [list(input()) for _ in range(n)]

def foo(x, y):
	if x < 0 or x >= n or y < 0 or (y >= n):
		return False
	if f[y][x] == '#':
		return False
	else:
		f[y][x] = '#'
		return True

def bar(x, y):
	if f[y][x] == '#':
		return True
	else:
		return foo(x - 1, y + 1) and foo(x, y + 1) and foo(x + 1, y + 1) and foo(x, y + 2)
yes = True
for y in range(n):
	for x in range(n):
		if not bar(x, y):
			print('NO')
			yes = False
			break
	if not yes:
		break
if yes:
	print('YES')


n = int(input())
matrix = [list(input()) for i in range(n)]
checker = [['#' for i in range(n)] for j in range(n)]
for i in range(1, n - 1):
	for j in range(1, n - 1):
		if matrix[i][j] == '.':
			if matrix[i - 1][j] == '.' and matrix[i + 1][j] == '.' and (matrix[i][j - 1] == '.') and (matrix[i][j + 1] == '.'):
				(matrix[i - 1][j], matrix[i + 1][j], matrix[i][j - 1], matrix[i][j + 1], matrix[i][j]) = ('#', '#', '#', '#', '#')
if matrix == checker:
	print('YES')
else:
	print('NO')


def judge(x, y):
	if x < 0 or x >= n or y < 0 or (y >= n) or (mp[x][y] == '#'):
		return 0
	mp[x][y] = '#'
	return 1
n = int(input())
mp = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	mp[i] = list(input())
for i in range(n):
	for j in range(n):
		if mp[i][j] == '.':
			flag = min(judge(i, j), judge(i + 1, j), judge(i + 2, j), judge(i + 1, j - 1), judge(i + 1, j + 1))
			if flag == 0:
				print('NO')
				exit(0)
print('YES')


n = int(input())
a = [[i for i in input().strip()] for j in range(n)]
for i in range(n):
	for j in range(n):
		if a[i][j] == '.':
			if j > 0 and j + 1 < n and (i + 2 < n):
				if a[i + 1][j - 1] == a[i + 1][j] == a[i + 1][j + 1] == a[i + 2][j] == '.':
					a[i][j] = a[i + 1][j - 1] = a[i + 1][j] = a[i + 1][j + 1] = a[i + 2][j] = '#'
for i in range(n):
	for c in a[i]:
		if c == '.':
			print('NO')
			exit(0)
print('YES')


import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil, log10, log2
from itertools import permutations
from heapq import heappush, heappop, heapify
inf = float('inf')
mod = 1000000007

def factorial_p(n, p):
	ans = 1
	if n <= p // 2:
		for i in range(1, n + 1):
			ans = ans * i % p
	else:
		for i in range(1, p - n):
			ans = ans * i % p
		ans = pow(ans, p - 2, p)
		if n % 2 == 0:
			ans = p - ans
	return ans

def nCr_p(n, r, p):
	ans = 1
	while n != 0 or r != 0:
		(a, b) = (n % p, r % p)
		if a < b:
			return 0
		ans = ans * factorial_p(a, p) * pow(factorial_p(b, p), p - 2, p) * pow(factorial_p(a - b, p), p - 2, p) % p
		n //= p
		r //= p
	return ans

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def is_prime(n):
	if n < 5 or n & 1 == 0 or n % 3 == 0:
		return 2 <= n <= 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			p = p * p % n
			if p == n - 1:
				break
		else:
			return False
	return True

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
mat = []
for i in range(n):
	z = input()
	lst = []
	for i in z:
		lst.append(i)
	mat.append(lst)
for i in range(n - 2):
	for j in range(1, n - 1):
		if mat[i][j] == '.' and mat[i + 1][j] == '.' and (mat[i + 2][j] == '.') and (mat[i + 1][j - 1] == '.') and (mat[i + 1][j + 1] == '.'):
			mat[i][j] = '#'
			mat[i + 1][j] = '#'
			mat[i + 2][j] = '#'
			mat[i + 1][j - 1] = '#'
			mat[i + 1][j + 1] = '#'
flag = 0
for i in range(n):
	for j in range(n):
		if mat[i][j] == '.':
			flag = 1
			break
if flag == 0:
	print('YES')
else:
	print('NO')


n = int(input())
shape = [(0, 0), (1, -1), (1, 0), (1, 1), (2, 0)]
empty_line = '#' * (n + 2)
A = [empty_line]
for _ in range(n):
	A += ['#' + input() + '#']
A += [empty_line]
B = set()
C = []
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if A[i][j] == '.':
			B.add((i, j))
			C += [(i, j)]
C.sort()
all_good = True
for p in C:
	if p not in B:
		continue
	for (oi, oj) in shape:
		op = (p[0] + oi, p[1] + oj)
		if op in B:
			B.remove(op)
		else:
			all_good = False
print('YES' if all_good else 'NO')


n = int(input())
l = []
for _ in range(n):
	x = list(input())
	l.append(x)
flag = True
for (x, i) in enumerate(l):
	for (y, j) in enumerate(i):
		if y == 0 and j == '.':
			flag = False
			break
		elif y == n - 1 and j == '.':
			flag = False
			break
		elif x >= n - 2 and j == '.':
			flag = False
			break
		elif j == '.' and (l[x + 1][y] != '.' or l[x + 1][y + 1] != '.' or l[x + 1][y - 1] != '.' or (l[x + 2][y] != '.')):
			flag = False
			break
		elif j == '.':
			l[x][y] = '#'
			l[x + 1][y] = '#'
			l[x + 1][y + 1] = '#'
			l[x + 1][y - 1] = '#'
			l[x + 2][y] = '#'
if not flag:
	print('NO')
else:
	print('YES')


a = int(input())
t = []
for _ in range(a):
	t.append([ele for ele in input()])
for j in range(1, len(t) - 1):
	for i in range(len(t[j]) - 1):
		if t[j][i] != '#' and t[j][i + 1] != '#' and (t[j - 1][i] != '#') and (t[j + 1][i] != '#') and (t[j][i - 1] != '#'):
			t[j][i] = '#'
			t[j][i + 1] = '#'
			t[j - 1][i] = '#'
			t[j + 1][i] = '#'
			t[j][i - 1] = '#'
flag = True
for num in t:
	for dum in num:
		if dum == '.':
			flag = False
if flag == False:
	print('NO')
else:
	print('YES')


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))
for i in range(n - 2):
	for j in range(1, n - 1):
		if matrix[i][j] == '.':
			if matrix[i + 1][j] == '.' and matrix[i + 2][j] == '.' and (matrix[i + 1][j - 1] == '.') and (matrix[i + 1][j + 1] == '.'):
				matrix[i][j] = '#'
				matrix[i + 1][j] = '#'
				matrix[i + 2][j] = '#'
				matrix[i + 1][j - 1] = '#'
				matrix[i + 1][j + 1] = '#'
			else:
				print('NO')
				return
for i in range(n):
	for j in range(n):
		if matrix[i][j] == '.':
			print('NO')
			return
print('YES')


import sys
n = int(input())
g = []
for _ in range(n):
	g.append(list(input()))
for i in range(1, n - 1):
	for j in range(1, n - 1):
		found = False
		if g[i][j] == '.' and g[i - 1][j] == '.' and (g[i][j - 1] == '.') and (g[i][j + 1] == '.') and (g[i + 1][j] == '.'):
			found = True
			g[i][j] = '#'
			g[i - 1][j] = '#'
			g[i][j - 1] = '#'
			g[i][j + 1] = '#'
			g[i + 1][j] = '#'
for r in g:
	if '.' in r:
		print('NO')
		sys.exit()
print('YES')