You are given a description of a depot. It is a rectangular checkered field of n × m size. Each cell in a field can be empty (".") or it can be occupied by a wall ("*"). 

You have one bomb. If you lay the bomb at the cell (x, y), then after triggering it will wipe out all walls in the row x and all walls in the column y.

You are to determine if it is possible to wipe out all walls in the depot by placing and triggering exactly one bomb. The bomb can be laid both in an empty cell or in a cell occupied by a wall.


-----Input-----

The first line contains two positive integers n and m (1 ≤ n, m ≤ 1000) — the number of rows and columns in the depot field. 

The next n lines contain m symbols "." and "*" each — the description of the field. j-th symbol in i-th of them stands for cell (i, j). If the symbol is equal to ".", then the corresponding cell is empty, otherwise it equals "*" and the corresponding cell is occupied by a wall.


-----Output-----

If it is impossible to wipe out all walls by placing and triggering exactly one bomb, then print "NO" in the first line (without quotes).

Otherwise print "YES" (without quotes) in the first line and two integers in the second line — the coordinates of the cell at which the bomb should be laid. If there are multiple answers, print any of them.


-----Examples-----
Input
3 4
.*..
....
.*..

Output
YES
1 2

Input
3 3
..*
.*.
*..

Output
NO

Input
6 5
..*..
..*..
*****
..*..
..*..
..*..

Output
YES
3 3

Difficulty: MEDIUM
Tags: Implementation

Starter code:

Solutions:
def main():
	(n, m) = list(map(int, input().split()))
	(xx, yy, walls, t) = ([0] * n, [0] * m, set(), 0)
	for x in range(n):
		for (y, c) in enumerate(input()):
			if c == '*':
				t += 1
				if t == n + m:
					print('NO')
					return
				walls.add((x, y))
				xx[x] += 1
				yy[y] += 1
	for (x, a) in enumerate(xx):
		for (y, b) in enumerate(yy):
			if a + b - ((x, y) in walls) == t:
				print('YES')
				print(x + 1, y + 1)
				return
	print('NO')

def __starting_point():
	main()
__starting_point()


import sys
from collections import Counter
(numrow, numcol) = sys.stdin.readline().split(' ')
numrow = int(numrow)
numcol = int(numcol)
row_index = []
col_index = []
row_counts = [0] * numrow
col_counts = [0] * numcol
row_highest = []
col_highest = []
row_highest_count = 0
col_highest_count = 0
for i in range(numrow):
	line = sys.stdin.readline().strip()
	for j in range(numcol):
		if line[j] == '*':
			row_counts[i] += 1
			col_counts[j] += 1
			row_index.append(i)
			col_index.append(j)
		if i == numrow - 1:
			if col_counts[j] > col_highest_count:
				col_highest_count = col_counts[j]
				col_highest = [j]
			elif col_counts[j] == col_highest_count:
				col_highest.append(j)
	if row_counts[i] > row_highest_count:
		row_highest_count = row_counts[i]
		row_highest = [i]
	elif row_counts[i] == row_highest_count:
		row_highest.append(i)
if len(row_index) == 0:
	print('YES')
	print('1 1')
elif len(row_index) == 1:
	print('YES')
	print(row_index[0] + 1, col_index[0] + 1)
elif len(row_index) == 2:
	print('YES')
	print(row_index[0] + 1, col_index[1] + 1)
elif row_highest_count >= 2 and len(row_highest) > 1:
	print('NO')
elif col_highest_count >= 2 and len(col_highest) > 1:
	print('NO')
elif len(row_index) > numrow + numcol - 1:
	print('NO')
elif row_highest_count >= col_highest_count:
	for row_h in row_highest[:2]:
		goodCol = -1
		for star in range(len(row_index)):
			if row_index[star] != row_h and goodCol < 0:
				goodCol = col_index[star]
			elif row_index[star] != row_h and goodCol != col_index[star]:
				print('NO')
				sys.exit(0)
		print('YES')
		print(row_h + 1, max(goodCol + 1, 1))
else:
	for col_h in col_highest[:2]:
		goodRow = -1
		for star in range(len(row_index)):
			if col_index[star] != col_h and goodRow < 0:
				goodRow = row_index[star]
			elif col_index[star] != col_h and goodRow != row_index[star]:
				print('NO')
				sys.exit(0)
		print('YES')
		print(max(goodRow + 1, 1), col_h + 1)


def solution():
	(n, m) = map(int, input().split())
	l = []
	r = [0] * 1001
	c = [0] * 1001
	cnt = 0
	for i in range(n):
		x = list(input())
		for j in range(m):
			if x[j] == '*':
				cnt += 1
				r[i] += 1
				c[j] += 1
		l.append(x)
	for i in range(n):
		for j in range(m):
			x = r[i] + c[j]
			if l[i][j] == '*':
				x -= 1
			if x == cnt:
				print('YES')
				print(i + 1, j + 1)
				exit(0)
	print('NO')
solution()


(n, m) = map(int, input().split())
s = [input() for i in range(n)]
h = [sum((1 if s[i][j] == '*' else 0 for j in range(m))) for i in range(n)]
v = [sum((1 if s[j][i] == '*' else 0 for j in range(n))) for i in range(m)]
c = sum(h)
ans = (-1, -1)
for i in range(n):
	for j in range(m):
		if h[i] + v[j] - (1 if s[i][j] == '*' else 0) == c:
			ans = (i, j)
if ans == (-1, -1):
	print('NO')
else:
	print('YES')
	print(ans[0] + 1, ans[1] + 1)


import sys
import math
import bisect

def solve(A):
	n = len(A)
	m = len(A[0])
	row = [0] * n
	col = [0] * m
	total = 0
	for i in range(n):
		for j in range(m):
			if A[i][j] == '*':
				row[i] += 1
				col[j] += 1
				total += 1
	for i in range(n):
		for j in range(m):
			val = row[i] + col[j]
			if A[i][j] == '*':
				val -= 1
			if val == total:
				return (i, j)
	return None

def main():
	(n, m) = map(int, input().split())
	A = []
	for i in range(n):
		A.append(input())
	ans = solve(A)
	if ans:
		print('YES')
		print('%d %d' % (ans[0] + 1, ans[1] + 1))
	else:
		print('NO')
main()


(a, b) = map(int, input().split())
x = []
w = 0
cx = [0 for i in range(b)]
cy = [0 for i in range(a)]
for i in range(a):
	z = input()
	w += z.count('*')
	cy[i] = z.count('*')
	x.append(z)
	places = [j for (j, K) in enumerate(list(z)) if K == '*']
	for l in places:
		cx[l] += 1
X = max(cx)
Y = max(cy)
tot = X + Y
i = []
for n in range(a):
	if cy[n] == Y:
		i.append(n)
j = []
for n in range(b):
	if cx[n] == X:
		j.append(n)
for n in i:
	for m in j:
		tot = X + Y
		if x[n][m] == '*':
			tot -= 1
		if tot == w:
			print('YES')
			print(n + 1, m + 1)
			quit()
print('NO')


st = input()
tmp = st.split(' ')
m = int(tmp[0])
n = int(tmp[1])
mapp = []
oc = []
for i in range(m):
	tmp = input()
	mapp.append(tmp)
	for j in range(n):
		if tmp[j] != '.':
			oc.append((i, j))
for x in range(m):
	for y in range(n):
		for i in oc:
			if i[0] != x and i[1] != y:
				break
		else:
			print('YES')
			print(x + 1, y + 1)
			return
else:
	print('NO')


import sys
(n, m) = map(int, input().split())
room = []
for i in range(n):
	room.append(list(input()))
row_wall = []
col_wall = []
for (i, j) in enumerate(room):
	row_wall.append(j.count('*'))
for (i, j) in enumerate(map(list, zip(*room))):
	col_wall.append(j.count('*'))
tot_walls = sum(col_wall)
for (x, j) in enumerate(room):
	for y in range(len(j)):
		cnt = 0
		if room[x][y] != '*':
			cnt = row_wall[x] + col_wall[y]
		else:
			cnt = row_wall[x] + col_wall[y] - 1
		if cnt == tot_walls:
			print('YES')
			print(x + 1, y + 1)
			sys.exit()
print('NO')


(n, m) = input().split()
n = int(n)
m = int(m)
bombs = []
for i in range(n):
	line = input()
	for j in range(m):
		if line[j] == '*':
			bombs.append((i, j))
if len(bombs) > n + m - 1:
	print('NO')
else:
	for i in range(n):
		bombs_left = [(r, c) for (r, c) in bombs if r != i]
		unique_cols = set([c for (r, c) in bombs_left])
		if len(unique_cols) == 0:
			print('YES')
			print(str(i + 1) + ' 1')
			break
		elif len(unique_cols) == 1:
			print('YES')
			print(str(i + 1) + ' ' + str(list(unique_cols)[0] + 1))
			break
	else:
		print('NO')


t = input
p = print
r = range
(n, m) = map(int, t().split())
(a, x, y, c) = ([], [0] * n, [0] * m, 0)
for i in r(n):
	a.append(t())
	for j in r(m):
		if a[i][j] == '*':
			x[i] += 1
			y[j] += 1
			c += 1
for i in r(n):
	for j in r(m):
		if x[i] + y[j] - (a[i][j] == '*') == c:
			p('YES\n', i + 1, ' ', j + 1, sep='')
			return
p('NO')


def bombs(array, rows, cols, walls, wallsInRows, wallsInCols):
	if walls == 0:
		print('YES')
		print(1, 1)
		return
	for i in range(0, rows):
		for j in range(0, cols):
			s = wallsInRows[i] + wallsInCols[j]
			if array[i][j] == '*' and s - 1 == walls or (array[i][j] == '.' and s == walls):
				print('YES')
				print(i + 1, j + 1)
				return
	print('NO')
	return

def readArray():
	k = input().split(' ')
	(rows, cols) = (int(k[0]), int(k[1]))
	array = []
	wallsInRows = []
	wallsInCols = [0 for i in range(0, cols)]
	walls = 0
	for i in range(0, rows):
		array.append(list(input()))
		wallsInRows.append(0)
		for j in range(0, cols):
			if array[i][j] == '*':
				wallsInRows[i] += 1
				wallsInCols[j] += 1
				walls += 1
	return (array, rows, cols, walls, wallsInRows, wallsInCols)
(array, rows, cols, walls, wallsInRows, wallsInCols) = readArray()
bombs(array, rows, cols, walls, wallsInRows, wallsInCols)


from collections import defaultdict
(n, m) = map(int, input().split())
counter = 0
a = []
b = defaultdict(list)
for i in range(n):
	inp = input()
	l = inp.count('*')
	counter += l
	if counter > m + n - 1:
		exit(print('NO'))
	a.append(inp)
	b[l].append(i + 1)
r = max(b.keys())
c = list(zip(*a))
for x in b[r]:
	for i in range(m):
		if c[i].count('*') + r - (a[x - 1][i] == '*') == counter:
			print('YES')
			print(x, i + 1)
			exit()
print('NO')


import logging as log

def filter_by_column(column, distribution):
	temp = []
	for cell in distribution:
		if cell[1] != column:
			temp.append(cell)
	return temp

def filter_by_row(row, distribution):
	temp = []
	for cell in distribution:
		if cell[0] != row:
			temp.append(cell)
	return temp

def same_row(distribution):
	if distribution:
		length = len(distribution)
		for index in range(length - 1):
			if distribution[index][0] != distribution[index + 1][0]:
				return False
	return True

def same_column(distribution):
	if distribution:
		length = len(distribution)
		for index in range(length - 1):
			if distribution[index][1] != distribution[index + 1][1]:
				return False
	return True

def OneBomb():
	log.basicConfig(level=log.CRITICAL)
	wall = '*'
	(n_rows, n_columns) = map(int, input().split())
	rows_density = [0] * n_rows
	columns_density = [0] * n_columns
	wall_distribution = []
	for row in range(n_rows):
		current_row = input().strip()
		rows_density[row] += current_row.count(wall)
		log.debug('current_row string: {}'.format(current_row))
		for column in range(n_columns):
			log.debug('column index: {}'.format(column))
			if current_row[column] == wall:
				columns_density[column] += 1
				wall_distribution.append((row + 1, column + 1))
	log.info('distribution: {}\nrow_density: {}\ncolumns_density:{}'.format(wall_distribution, rows_density, columns_density))
	max_column_density = columns_density.index(max(columns_density)) + 1
	max_row_density = rows_density.index(max(rows_density)) + 1
	log.info('max_column_density:{}\nmax_row_density:{}'.format(max_column_density, max_row_density))
	if max(columns_density) > max(rows_density):
		mod_density = filter_by_column(max_column_density, wall_distribution)
		log.info('mod_density:', *mod_density)
		if same_row(mod_density):
			print('YES')
			if mod_density:
				print(mod_density[0][0], max_column_density)
			else:
				print(1, max_column_density)
		else:
			print('NO')
	else:
		mod_density = filter_by_row(max_row_density, wall_distribution)
		if same_column(mod_density):
			print('YES')
			if mod_density:
				print(max_row_density, mod_density[0][1])
			else:
				print(max_row_density, 1)
		else:
			print('NO')
OneBomb()


import array
import itertools
IMPOSSIBLE = (-1, -1)

def place_bomb(height, width, is_wall):
	walls_row = array.array('L', (sum(row) for row in is_wall))
	walls_column = array.array('L')
	for column_idx in range(width):
		walls_column.append(sum((is_wall[r][column_idx] for r in range(height))))
	total_walls = sum(walls_row)
	for (bomb_r, bomb_c) in itertools.product(range(height), range(width)):
		wiped_walls = walls_row[bomb_r] + walls_column[bomb_c]
		wiped_walls -= is_wall[bomb_r][bomb_c]
		if wiped_walls == total_walls:
			return (bomb_r + 1, bomb_c + 1)
	else:
		return IMPOSSIBLE

def main():
	(height, width) = map(int, input().split())
	is_wall = [array.array('B', map(lambda c: c == '*', input())) for _ in range(height)]
	ans = place_bomb(height, width, is_wall)
	if ans != IMPOSSIBLE:
		print('YES')
		print(*ans)
	else:
		print('NO')
main()


(row, col) = map(int, input().split())
a = []
for i in range(row):
	s = input()
	a.append(s)
x = [i.count('*') for i in a]
ao = []
for i in range(col):
	new = ''
	for j in range(row):
		new += a[j][i]
	ao.append(new)
y = [i.count('*') for i in ao]
total = sum(x)
for i in range(row):
	for j in range(col):
		cnt = x[i] + y[j]
		if a[i][j] == '*':
			cnt -= 1
		if total == cnt:
			print('YES')
			print(i + 1, j + 1)
			exit(0)
print('NO')


(n, m) = map(int, input().split())
s = [input() for i in range(n)]
k = sum((s[i].count('*') for i in range(n)))
r = [i.count('*') for i in s]
c = [i.count('*') for i in zip(*s)]
for i in range(n):
	for j in range(m):
		if r[i] + c[j] - (s[i][j] == '*') == k:
			print('YES\n', i + 1, j + 1)
			exit(0)
print('NO')


(n, m) = map(int, input().split())
mat = [input() for i in range(n)]
x = [0] * n
y = [0] * m
c = 0
for i in range(n):
	for j in range(m):
		if mat[i][j] == '*':
			x[i] += 1
			y[j] += 1
			c += 1
for i in range(n):
	for j in range(m):
		if x[i] + y[j] - ('*' == mat[i][j]) == c:
			print('YES\n', i + 1, ' ', j + 1)
			exit(0)
print('NO\n')


import sys, math, string, fractions, functools, collections
sys.setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().rstrip().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 1010
col = [0] * MAX
row = [0] * MAX
tot = 0
(n, m) = RI()
s = [0] * MAX
for i in range(n):
	s[i] = RS()[0]
	for j in range(m):
		if s[i][j] == '*':
			row[i] += 1
			col[j] += 1
			tot += 1
for i in range(n):
	for j in range(m):
		if row[i] + col[j] - (s[i][j] == '*') == tot:
			print('YES')
			print(i + 1, j + 1)
			exit(0)
print('NO')


(x, y) = list(map(int, input().split(' ')))
(map_x, map_y) = ({}, {})
(max_r, max_rv) = (0, 0)
(max_c, max_cv) = (0, 0)
str_l = []
for _ in range(x):
	str = input()
	str_l.append(str)
	for i in range(len(str)):
		if str[i] == '*':
			if i not in map_y:
				map_y[i] = {}
			map_y[i][_] = None
str_t = list(zip(*str_l))
for _ in range(y):
	walls = str_t[_].count('*')
	if walls > max_cv:
		max_c = _
		max_cv = walls
for _ in range(x):
	walls = str_l[_].count('*')
	if walls > max_rv:
		max_r = _
		max_rv = walls
	elif walls == max_rv:
		if str_l[_][max_c] == '.':
			max_r = _
			max_rv = walls

def check(r, c):
	sum = 1 if c in map_y else 0
	for yy in range(y):
		if yy in map_y and yy != c:
			if len(map_y[yy]) == 1 and r in map_y[yy]:
				sum += 1
	return len(map_y) == sum
for c in range(y):
	if check(max_r, c) is True:
		print('YES')
		print(max_r + 1, c + 1)
		exit(0)
print('NO')


[n, m] = list(map(int, input().split()))
s = []
for i in range(n):
	s.append(input())
r = []
c = []
tot = 0
for x in range(n):
	cnt = 0
	for y in range(m):
		if s[x][y] == '*':
			cnt += 1
	r.append(cnt)
for y in range(m):
	cnt = 0
	for x in range(n):
		if s[x][y] == '*':
			cnt += 1
	c.append(cnt)
for x in range(n):
	for y in range(m):
		if s[x][y] == '*':
			tot += 1
for x in range(n):
	for y in range(m):
		cnt = r[x] + c[y]
		if s[x][y] == '*':
			cnt -= 1
		if cnt == tot:
			print('YES')
			print(' '.join(map(str, [x + 1, y + 1])))
			exit(0)
print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
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')
(n, m) = map(int, input().split())
s = [input() for i in range(n)]
k = sum((s[i].count('*') for i in range(n)))
r = [i.count('*') for i in s]
c = [i.count('*') for i in zip(*s)]
for i in range(n):
	for j in range(m):
		if r[i] + c[j] - (s[i][j] == '*') == k:
			print('YES\n', i + 1, j + 1)
			exit(0)
print('NO')


(n, m) = map(int, input().split())
a = [input() for i in range(n)]
x = [0] * n
y = [0] * m
cnt = 0
for i in range(n):
	for j in range(m):
		if a[i][j] == '*':
			x[i] += 1
			y[j] += 1
			cnt += 1
for i in range(n):
	for j in range(m):
		cur = x[i] + y[j] - (a[i][j] == '*')
		if cur == cnt:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


[n, m] = map(int, input().split())
xy = []
for i in range(n):
	for (j, k) in enumerate(input()):
		if k == '*':
			xy.append((i + 1, j + 1))
(x, y) = (0, 0)
for (i, j) in xy:
	if x == 0:
		x = i
	elif x != i:
		if y == 0:
			y = j
		elif y != j:
			x = -1
			break
if x == -1:
	(x, y) = (0, 0)
	for (i, j) in xy:
		if y == 0:
			y = j
		elif y != j:
			if x == 0:
				x = i
			elif x != i:
				x = -1
				break
if x == -1:
	print('NO')
else:
	print('YES')
	print('%d %d' % (max(x, 1), max(y, 1)))


def pro():
	(n, m) = map(int, input().split())
	a = []
	x = [0 for i in range(m)]
	y = [0 for i in range(n)]
	count = 0
	for i in range(n):
		a.append(list(input()))
		for j in range(len(a[i])):
			if a[i][j] == '*':
				x[j] += 1
				y[i] += 1
				count += 1
	for i in range(n):
		for j in range(m):
			if a[i][j] == '*' and x[j] + y[i] - 1 == count:
				print('YES')
				print(i + 1, j + 1)
				exit(0)
			elif x[j] + y[i] == count and a[i][j] != '*':
				print('YES')
				print(i + 1, j + 1)
				exit(0)
	print('NO')
pro()


import sys
import os
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')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	return [[default for j in range(m)] for i in range(n)]

def arr3D(n, m, r, default=0):
	return [[[default for k in range(r)] for j in range(m)] for i in range(n)]

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

class DSU:

	def __init__(self, length):
		self.length = length
		self.parent = [-1] * self.length

	def getParent(self, node, start):
		if node >= self.length:
			return False
		if self.parent[node] < 0:
			if start != node:
				self.parent[start] = node
			return node
		return self.getParent(self.parent[node], start)

	def union(self, node1, node2):
		parent1 = self.getParent(node1, node1)
		parent2 = self.getParent(node2, node2)
		if parent1 == parent2:
			return False
		elif self.parent[parent1] <= self.parent[parent2]:
			self.parent[parent1] += self.parent[parent2]
			self.parent[parent2] = parent1
		else:
			self.parent[parent2] += self.parent[parent1]
			self.parent[parent1] = parent2
		return True

	def getCount(self, node):
		return -self.parent[self.getParent(node, node)]

def exact(num):
	if abs(num - round(num)) <= 10 ** (-9):
		return round(num)
	return num

def solve(n, m, lst):
	points = []
	rowCount = {}
	colCount = {}
	get = False
	for i in range(n):
		for j in range(m):
			if lst[i][j] == '*':
				points.append([i, j])
				if rowCount.get(i) == None:
					rowCount[i] = 0
				rowCount[i] += 1
				if colCount.get(j) == None:
					colCount[j] = 0
				colCount[j] += 1
				get = True
	if points == []:
		print('YES\n1 1')
		return
	(x, y) = (-1, -1)
	for i in range(1000):
		for j in range(1000):
			if rowCount.get(i) != None and colCount.get(j) != None:
				val = rowCount[i] + colCount[j]
				if lst[i][j] == '*':
					val -= 1
				if val >= len(points):
					if y == -1 or y == i:
						y = i
					if x == -1 or x == j:
						x = j
	if x == -1 and y == -1:
		if len(points) >= 2:
			x = points[0][1]
			y = points[1][0]
		else:
			(y, x) = points[0]
	if x == -1 and y == -1 and get:
		print('NO')
		return
	if x == -1:
		x += 1
	if y == -1:
		y += 1
	for i in points:
		if i[0] != y and i[1] != x:
			print('NO')
			return
	print('YES')
	print(y + 1, x + 1)
(n, m) = list(map(int, input().split()))
lst = []
for i in range(n):
	lst.append(input())
solve(n, m, lst)


(n, m) = map(int, input().split())
r = list()
c = list()
for i in range(m):
	c.append(0)
x = list()
for i in range(n):
	cur = str(input())
	count = cur.count('*')
	r.append(count)
	for j in range(m):
		if cur[j] == '*':
			c[j] += 1
	x.append(cur)
tot = sum(r)
for i in range(n):
	for j in range(m):
		if x[i][j] == '*':
			if r[i] + c[j] - 1 == tot:
				print('YES')
				print(i + 1, j + 1)
				exit()
		elif r[i] + c[j] == tot:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


(n, m) = map(int, input().split())
g = [list(input()) for _ in range(n)]
b = [(i, j) for i in range(n) for j in range(m) if g[i][j] == '*'] or [(0, 0)]
if n * m * len(b) < 1000000:
	found = None
	for i in range(n):
		for j in range(m):
			yes = True
			for (x, y) in b:
				if x != i and y != j:
					yes = False
			if yes:
				found = (i + 1, j + 1)
	if found:
		print('YES')
		print(' '.join(map(str, found)))
	else:
		print('NO')
else:
	x = dict()
	y = dict()
	for (i, j) in b:
		x[i] = x.get(i, 0) + 1
		y[j] = y.get(j, 0) + 1
	max_x = max(x, key=lambda v: (x[v], y.get(v, 0)))
	max_y = max(y, key=lambda v: (y[v], x.get(v, 0)))
	for (i, j) in b:
		if i != max_x and j != max_y:
			print('NO')
			break
	else:
		print('YES')
		print(max_x + 1, max_y + 1)


def str_inp(n):
	return [input() for x in range(n)]

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

def get_col(arr, i):
	return ''.join([row[i] for row in arr])
from sys import *
from collections import defaultdict
(r, c) = arr_inp()
(depot, total, memr, memc) = (str_inp(r), 0, defaultdict(int), defaultdict(int))
for i in range(r):
	row = depot[i].count('*')
	memr[i] = row
	total += row
for i in range(c):
	col = get_col(depot, i).count('*')
	memc[i] = col
for i in range(r):
	for j in range(c):
		num = total - (memr[i] + memc[j])
		if depot[i][j] == '*':
			num += 1
		if num == 0:
			print('YES')
			exit(print(i + 1, j + 1))
print('NO')


import sys
input = lambda : sys.stdin.readline()
MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : list(map(int, input().split()))
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
lr = []
lc = []
l = []
(n, m) = f()
cnt = 0
for _ in range(n):
	x = si()
	cnt = x.count('*')
	lr.append(cnt)
	l.append(x)
for i in range(m):
	cnt = 0
	for j in range(n):
		cnt += l[j][i] == '*'
	lc.append(cnt)
tcnt = sum(lr)
for i in range(n):
	for j in range(m):
		if lr[i] + lc[j] - (l[i][j] == '*') == tcnt:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


(n, lines) = (int(input().split(' ')[0]), [])
for i in range(0, n):
	line = input()
	lines.append(line)
(rc, cc, total) = ([0] * n, [0] * len(lines[0]), 0)
for (i, line) in enumerate(lines):
	for (j, ch) in enumerate(line):
		if ch == '*':
			rc[i] += 1
			cc[j] += 1
			total += 1
(x, y) = (-1, -1)
for (i, line) in enumerate(lines):
	for (j, ch) in enumerate(line):
		count = rc[i] + cc[j]
		if ch == '*':
			count -= 1
		if count == total:
			(x, y) = (i, j)
			break
if x == -1:
	print('NO')
else:
	print('YES')
	print(x + 1, y + 1)


__author__ = 'artyom'

def main():
	(n, m) = read(3)
	w1 = w2 = b = None
	for i in range(n):
		s = read(0)
		for j in range(m):
			if s[j] == '*':
				if w1 is None:
					w1 = [i, j]
				elif w2 is None:
					w2 = [i, j]
				elif b is None:
					if w1[0] == w2[0]:
						if w1[0] < i:
							b = [w1[0], j]
					elif w1[1] == w2[1]:
						if w1[1] != j:
							b = [i, w1[1]]
					elif w2[0] == i:
						b = [i, w1[1]]
					elif w1[1] == j:
						b = [w2[0], j]
					elif w2[1] == j:
						b = [w1[0], j]
					else:
						return 'NO'
				elif b[0] != i and b[1] != j:
					return 'NO'
	if b is None:
		if w1 is None:
			b = [0, 0]
		elif w2 is None:
			b = w1
		else:
			b = [w1[0], w2[1]]
	return 'YES\n' + str(b[0] + 1) + ' ' + str(b[1] + 1)

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


(a, b) = map(int, input().split())
(x, y, t) = ([0] * a, [0] * b, 0)
p = [0] * a
for r in range(a):
	i = input()
	p[r] = i
	for c in range(b):
		if i[c] == '*':
			t += 1
			x[r] += 1
			y[c] += 1
for x1 in range(a):
	for y1 in range(b):
		if p[x1][y1] == '*':
			if x[x1] + y[y1] - 1 == t:
				print('YES')
				print(x1 + 1, y1 + 1)
				quit()
		elif x[x1] + y[y1] == t:
			print('YES')
			print(x1 + 1, y1 + 1)
			quit()
else:
	print('NO')


(n, m) = map(int, input().split())
a = []
columns = [0] * m
rows = [0] * n
k = 0
for i in range(n):
	a.append(list(input()))
	for j in range(m):
		if a[i][j] == '*':
			k += 1
			rows[i] += 1
			columns[j] += 1
for i in range(n):
	for j in range(m):
		d = rows[i] + columns[j]
		if a[i][j] == '*':
			d -= 1
		if d == k:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


(row, col) = [int(i) for i in input().split()]
grid = []
total_walls = 0
G = [0] * row
V = [0] * col
check = False
for i in range(row):
	a = input()
	total_walls += a.count('*')
	grid.append(a)
	G[i] = a.count('*')
X = ['']
X = X * col
for i in grid:
	for j in range(col):
		X[j] += i[j]
for j in range(col):
	V[j] = X[j].count('*')
for i in range(row):
	for j in range(col):
		if grid[i][j] == '.':
			cur = G[i] + V[j]
		else:
			cur = G[i] + V[j] - 1
		if cur == total_walls:
			print('YES')
			print(i + 1, j + 1)
			check = True
			break
	if check == True:
		break
if check == False:
	print('NO')


t = input
p = print
r = range
s = sum
(n, m) = map(int, t().split())
a = [t() for i in r(n)]
g = [[a[j][i] for j in r(n)] for i in r(m)]
(x, y) = ([a[i].count('*') for i in r(n)], [g[i].count('*') for i in r(m)])
c = (s(x) + s(y)) // 2
[(p('YES\n', i + 1, ' ', j + 1, sep=''), exit(0)) if x[i] + y[j] - (a[i][j] == '*') == c else 0 for j in r(m) for i in r(n)]
p('NO')


def STR():
	return list(input())

def INT():
	return int(input())

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

def MAP2():
	return map(float, input().split())

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

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
(n, m) = MAP()
g = []
rows = []
cols = []
cells = []
cnt = 0
freq = [0] * n
freq2 = [0] * m
for i in range(n):
	s = STR()
	for j in range(m):
		if s[j] == '*':
			rows.append(i)
			cols.append(j)
			cnt += 1
			cells.append([i, j])
			freq[i] += 1
			freq2[j] += 1
if cnt == 0:
	print('YES')
	print(1, 1)
	exit(0)
mx = max(freq)
mxrow = 0
mxc = 0
mx2 = max(freq2)
for i in range(len(freq)):
	if freq[i] == mx:
		mxrow = i
		break
for i in range(len(freq2)):
	if freq2[i] == mx2:
		mxc = i
		break
if freq[mxrow] > 1:
	a = []
	for i in range(len(cells)):
		if cells[i][0] == mxrow:
			continue
		else:
			a.append(cells[i][1])
	if len(set(a)) > 1:
		print('NO')
		exit(0)
	if len(a) == 0:
		print('YES')
		print(mxrow + 1, 1)
	else:
		print('YES')
		print(mxrow + 1, a[0] + 1)
else:
	a = []
	for i in range(len(cells)):
		if cells[i][1] == mxc:
			continue
		else:
			a.append(cells[i][0])
	if len(set(a)) > 1:
		print('NO')
		exit(0)
	if len(a) == 0:
		print('YES')
		print(1, mxc + 1)
	else:
		print('YES')
		print(a[0] + 1, mxc + 1)


(n, m) = map(int, input().split())
(r, c, l, z) = ([0] * n, [0] * m, [], 0)
for i in range(n):
	q = input()
	l += [q]
	for j in range(m):
		if q[j] == '*':
			r[i] += 1
			c[j] += 1
			z += 1
for i in range(n):
	for j in range(m):
		if r[i] + c[j] - (l[i][j] == '*') == z:
			exit(print('YES\n', i + 1, j + 1))
print('NO')


def main():
	(n, m) = map(int, input().split())
	d = [[0] * m for i in range(n)]
	al = 0
	val_x = [0] * n
	val_y = [0] * m
	for i in range(n):
		s = input()
		cnt = 0
		for j in range(m):
			d[i][j] = s[j]
			cnt += s[j] == '*'
			al += s[j] == '*'
		val_x[i] = cnt
	for i in range(m):
		cnt = 0
		for j in range(n):
			cnt += d[j][i] == '*'
		val_y[i] = cnt
	for i in range(n):
		for j in range(m):
			if val_x[i] + val_y[j] - (d[i][j] == '*') == al:
				print('YES')
				print(i + 1, j + 1)
				exit()
	print('NO')
main()


def oneRowOneColumn(matrix):
	i = 0
	row = -1
	rowc = 0
	column = -1
	while i < len(matrix):
		if matrix[i].count('*') > 1:
			if row == -1:
				row = i
				rowc = 2
			else:
				return ['NO']
		elif matrix[i].count('*') == 1:
			if column == -1:
				column = matrix[i].index('*')
			elif column != matrix[i].index('*'):
				if row == -1:
					row = i
					rowc = 1
				elif rowc == 2:
					return ['NO']
				elif matrix[i].index('*') == matrix[row].index('*'):
					count = 0
					first = 0
					e = 0
					while e < len(matrix):
						if matrix[e][column] == '*':
							count += 1
							first = e
						e += 1
					if count > 1:
						return 'NO'
					else:
						column = matrix[i].index('*')
						row = first
						rowc = 2
				else:
					return ['NO']
		i += 1
	row = 1 if row == -1 else row + 1
	column = 1 if column == -1 else column + 1
	return ['YES', str(row) + ' ' + str(column)]
i = input().split(' ')
matrix = list()
for e in range(int(i[0])):
	matrix.append(input())
for e in oneRowOneColumn(matrix):
	print(e)


(n, m) = map(int, input().split())
l_w = list()
for _ in range(n):
	l_w.append(input())
h = [0] * m
v = [0] * n
w_c = 0
for (i, s) in enumerate(l_w):
	for (j, c) in enumerate(s):
		if c == '*':
			h[j] += 1
			v[i] += 1
			w_c += 1
for i in range(n):
	for j in range(m):
		if h[j] + v[i] - (l_w[i][j] == '*') == w_c:
			print('YES\n%d %d' % (i + 1, j + 1))
			exit()
print('NO')


(n, m) = list(map(int, input().split()))
a = [input() for i in range(n)]
cntx = [0] * n
cnty = [0] * m
cnt = 0
for i in range(n):
	for j in range(m):
		if a[i][j] == '*':
			cntx[i] += 1
			cnty[j] += 1
			cnt += 1
for i in range(n):
	for j in range(m):
		cur = cntx[i] + cnty[j] - int(a[i][j] == '*')
		if cur == cnt:
			print('YES')
			print(i + 1, j + 1)
			return
print('NO')


(n, m) = map(int, input().split())
a = []
for i in range(n):
	s = input()
	a.append(s)
r = [0] * n
c = [0] * m
f = 0
cnt = 0
for i in range(n):
	for j in range(m):
		if a[i][j] == '*':
			r[i] += 1
			c[j] += 1
			cnt += 1
r1 = 0
c1 = 0
for i in range(n):
	if f:
		break
	for j in range(m):
		d = r[i] + c[j]
		if a[i][j] == '*':
			d -= 1
		if d == cnt:
			f = 1
			r1 = i
			c1 = j
			break
if f == 0:
	print('NO')
else:
	print('YES')
	print(r1 + 1, c1 + 1)


inp = input().split(' ')
rows = int(inp[0])
cols = int(inp[1])
mat = []
for i in range(0, rows):
	mat.append(list(input()))
v = []
g = []
for i in range(0, cols):
	v.append(0)
for i in range(0, rows):
	g.append(0)
total = 0
for (y, row) in enumerate(mat):
	for (x, el) in enumerate(row):
		if el == '*':
			total += 1
			g[y] += 1
			v[x] += 1
point = []
for (y, row) in enumerate(mat):
	for (x, el) in enumerate(row):
		suma = g[y] + v[x]
		if el == '*':
			suma -= 1
		if suma >= total:
			point = [x + 1, y + 1]
if point:
	print('YES')
	print(point[1], point[0])
else:
	print('NO')


from collections import defaultdict
(n, m) = map(int, input().split())
arr = []
for i in range(n):
	arr.append(list(input()))
row_count = [0] * n
col_count = [0] * m
for i in range(n):
	row_count[i] = arr[i].count('*')
for i in range(m):
	temp = 0
	for j in range(n):
		if arr[j][i] == '*':
			temp += 1
	col_count[i] = temp
total_count = 0
for i in range(n):
	for j in range(m):
		if arr[i][j] == '*':
			total_count += 1
for i in range(n):
	for j in range(m):
		cnt = row_count[i] + col_count[j]
		if arr[i][j] == '*':
			cnt -= 1
		if cnt == total_count:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


array = []
a = list(map(int, input().split()))
if a[0] == 1 or a[1] == 1:
	for i in range(a[0]):
		tmp = input()
	print('YES')
	print('1 1')
else:
	r = [0 for i in range(a[0])]
	c = [0 for i in range(a[1])]
	TOTAL = 0
	for i in range(a[0]):
		tmp = input()
		array.append(tmp)
		if '*' in tmp:
			r[i] += tmp.count('*')
			TOTAL += r[i]
			for j in range(tmp.find('*'), a[1]):
				if tmp[j] == '*':
					c[j] += 1
	max = max(c)
	for i in range(a[0]):
		if r[i] + max >= TOTAL:
			for j in range(a[1]):
				if r[i] + c[j] >= TOTAL:
					DF0X = r[i] + c[j]
					if array[i][j] == '*':
						DF0X -= 1
					if DF0X == TOTAL:
						print('YES')
						print(i + 1, end=' ')
						print(j + 1)
						exit(0)
	print('NO')


def p1():
	(n, m) = [float(i) for i in input().split('e')]
	if n * 10 ** m == int(n * 10 ** m):
		print(int(n * 10 ** m))
	else:
		print(n * 10 ** m)

def p2():
	n = int(input())
	l = [int(i) for i in input().split()]
	ans = 'YES'
	if n == 1:
		if l.count(0) == 1:
			ans = 'NO'
	elif l.count(0) != 1:
		ans = 'NO'
	print(ans)

def p3():
	(n, m) = [int(i) for i in input().split()]
	k = 0
	m2 = 0
	for j in range(m):
		a = input()
		if a.count('1') == len(a):
			m2 = max(m2, k)
			k = 0
		else:
			k = k + 1
	m2 = max(m2, k)
	print(m2)

def p4():
	(n, m) = [int(i) for i in input().split()]
	t = 0
	l = m
	for i in range(n):
		a = input().split()
		b = int(a[1])
		a = a[0]
		if a == '+':
			l = l + b
		elif l >= b:
			l = l - b
		else:
			t = t + 1
	print(l, t)

def p5():
	(n, m) = [int(i) for i in input().split()]
	l = []
	v = []
	g = []
	for i in range(n):
		s = input()
		l.append(s)
		v.append(s.count('*'))
	for i in range(m):
		t = 0
		for j in range(n):
			if l[j][i] == '*':
				t = t + 1
		g.append(t)
	ans = 'NO'
	c = sum(v)
	for i in range(n):
		for j in range(m):
			t = v[i] + g[j]
			if l[i][j] == '*':
				t = t - 1
			if t == c:
				ans = 'YES'
				(x, y) = (i + 1, j + 1)
				break
		if ans == 'YES':
			break
	print(ans)
	if ans == 'YES':
		print(x, y)
p5()


(n, m) = map(int, input().split())
T = [[] for i in range(n)]
H = [0] * n
W = [0] * m
num = 0
for i in range(n):
	s = list(input())
	T[i] = s
	for j in range(m):
		if s[j] == '*':
			H[i] += 1
			W[j] += 1
			num += 1
for i in range(n):
	for j in range(m):
		tmp = H[i] + W[j] - int(T[i][j] == '*')
		if num == tmp:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
(n, m) = ilele()
A = []
for i in range(n):
	B = input()
	A.append(B)
c = 0
(k1, k2) = (-1, -1)
for i in range(n):
	for j in range(m):
		if A[i][j] == '*':
			c += 1
			(k1, k2) = (i, j)
if c == 0:
	Y(1)
	print(1, 1)
	exit(0)

def fun(i, j):
	d = 0
	for l in range(n):
		if A[l][j] == '*':
			d += 1
	for l in range(m):
		if A[i][l] == '*':
			d += 1
	if A[i][j] == '*':
		d -= 1
	return d
F = [k1, k2]
for i in range(n):
	for j in range(m):
		if i in F or j in F:
			d = fun(i, j)
			if c == d:
				Y(1)
				print(i + 1, j + 1)
				exit(0)
Y(0)


import sys
input = sys.stdin.readline
(n, m) = map(int, input().split())
s = [input() for i in range(n)]
row = [0] * n
col = [0] * m
bom = 0
for i in range(n):
	for j in range(m):
		row[i] += s[i][j] == '*'
		col[j] += s[i][j] == '*'
		bom += s[i][j] == '*'
for i in range(n):
	for j in range(m):
		if row[i] + col[j] - (s[i][j] == '*') == bom:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


(n, m) = [int(x) for x in input().split()]
depot = []
r = []
c = []
flag = True
for i in range(n):
	row = input()
	r.append(row.count('*'))
	depot.append(row)
for j in range(m):
	column = ''.join([x[j] for x in depot])
	c.append(column.count('*'))
wall = sum(r)
for i in range(n):
	for j in range(m):
		if depot[i][j] == '*':
			bomb = r[i] + c[j] - 1
		else:
			bomb = r[i] + c[j]
		if bomb == wall:
			print('YES')
			print(i + 1, j + 1)
			flag = False
			break
	if not flag:
		break
if flag:
	print('NO')


(n, m) = list(map(int, input().split()))
p = []
ans = 0
for i in range(n):
	s = input()
	ans += s.count('*')
	p.append(s)
dp = []
for i in range(n):
	dp.append([0] * m)
for i in range(n):
	col = p[i].count('*')
	for t in range(m):
		dp[i][t] = col
for i in range(m):
	col = 0
	for t in range(n):
		if p[t][i] == '*':
			col += 1
	for t in range(n):
		dp[t][i] += col
f = False
for i in range(n):
	for t in range(m):
		if dp[i][t] - int(p[i][t] == '*') == ans:
			f = True
			print('YES')
			print(i + 1, t + 1)
			break
	if f:
		break
if not f:
	print('NO')


(n, m) = input().split()
(n, m) = (int(n), int(m))
s = []
for i in range(n):
	s.append(str(input()))
(cnt, cntr, cntc) = (0, [], [])
for i in range(n):
	tcnt = 0
	for j in range(m):
		if s[i][j] == '*':
			tcnt += 1
	cntr.append(tcnt)
for i in range(m):
	tcnt = 0
	for j in range(n):
		if s[j][i] == '*':
			tcnt += 1
			cnt += 1
	cntc.append(tcnt)
(ai, aj) = (-1, -1)
for i in range(n):
	for j in range(m):
		tmp = cntr[i] + cntc[j]
		if s[i][j] == '*':
			tmp -= 1
		if tmp == cnt:
			(ai, aj) = (i, j)
if ai == -1:
	print('NO')
else:
	print('YES')
	print(str(ai + 1) + ' ' + str(aj + 1))


def main():
	(n, m) = map(int, input().split())
	(indx, indy, walls, t) = ([0] * n, [0] * m, set(), n + m)
	for x in range(n):
		for (y, c) in enumerate(input()):
			if c == '*':
				walls.add((x, y))
				if len(walls) == t:
					print('NO')
					return
				indx[x] += 1
				indy[y] += 1
	for (x, a) in enumerate(indx):
		t = len(walls) - a
		for (y, b) in enumerate(indy):
			if b - ((x, y) in walls) == t:
				print('YES')
				print(x + 1, y + 1)
				return
	print('NO')
main()


def main():
	(n, m) = [int(x) for x in input().split()]
	board = []
	cols = [0] * m
	rows = [0] * n
	total = 0
	for i in range(0, n):
		r = input()
		board.append(r)
		for j in range(0, m):
			if r[j] == '*':
				cols[j] += 1
				rows[i] += 1
				total += 1
	for i in range(0, n):
		for j in range(0, m):
			count = rows[i] + cols[j]
			if board[i][j] == '*':
				count -= 1
			if count == total:
				print('YES')
				print(i + 1, j + 1)
				return
	print('NO')
main()


def main():
	(n, m) = (int(x) for x in input().split())
	depot = [None] * n
	for i in range(n):
		depot[i] = input()
	(valid, location) = solver(depot)
	if valid == 'YES':
		print('YES')
		(row, col) = location
		print(row + 1, col + 1)
	else:
		print('NO')

def solver(depot):
	bombs = [None] * len(depot)
	for row in range(len(depot)):
		bombs[row] = bombCount(depot[row])
	bombRows = [row for row in range(len(bombs)) if bombs[row] == 'multiple']
	if len(bombRows) > 1:
		return ('NO', None)
	else:
		bombSet = set(bombs)
		bombSet.discard('multiple')
		bombSet.discard('-1')
		if len(bombRows) == 1:
			if len(bombSet) > 1:
				return ('NO', None)
			elif len(bombSet) == 1:
				col = bombSet.pop()
				return ('YES', (bombRows[0], int(col)))
			else:
				return ('YES', (bombRows[0], 0))
		elif len(bombRows) == 0:
			if len(bombSet) > 2:
				return ('NO', None)
			elif len(bombSet) == 2:
				col1 = bombSet.pop()
				col2 = bombSet.pop()
				col1Rows = [row for row in range(len(bombs)) if bombs[row] == col1]
				col2Rows = [row for row in range(len(bombs)) if bombs[row] == col2]
				if len(col1Rows) > 1:
					if len(col2Rows) > 1:
						return ('NO', None)
					else:
						return ('YES', (col2Rows[0], int(col1)))
				else:
					return ('YES', (col1Rows[0], int(col2)))
			elif len(bombSet) == 1:
				col = bombSet.pop()
				return ('YES', (0, int(col)))
			else:
				return ('YES', (0, 0))
		else:
			assert False

def bombCount(s):
	count = 0
	bombCol = -1
	for col in range(len(s)):
		if s[col] == '*':
			count += 1
			bombCol = col
	if count > 1:
		return 'multiple'
	else:
		return str(bombCol)
main()


(R, C) = [int(x) for x in input().split()]
grid = [list(input()) for _ in range(R)]
wpr = [0] * R
wpc = [0] * C
n = 0
for r in range(R):
	for c in range(C):
		if grid[r][c] != '*':
			continue
		wpr[r] += 1
		wpc[c] += 1
		n += 1
for r in range(R):
	for c in range(C):
		field = 1 if grid[r][c] == '*' else 0
		if wpr[r] + wpc[c] - field == n:
			print('YES')
			print(r + 1, c + 1)
			return
print('NO')


(n, m) = tuple(map(int, input().split()))
rows = {}
cols = {}
walls = 0
for i in range(n):
	line = input()
	for j in range(m):
		if line[j] == '*':
			walls += 1
			if i in rows:
				rows[i].append(j)
			else:
				rows[i] = [j]
			if j in cols:
				cols[j].append(i)
			else:
				cols[j] = [i]

def get_def(d):
	ans = -1
	for c in d:
		if len(d[c]) > 1:
			if ans != -1:
				return -10
			ans = c
	return ans
dr = get_def(rows)
dc = get_def(cols)
if dr == -10 or dc == -10:
	print('NO')
elif dr != -1 and dc != -1:
	ok = True
	for r in rows:
		if r == dr:
			continue
		for c in rows[r]:
			if c != dc:
				ok = False
	for c in cols:
		if c == dc:
			continue
		for r in cols[c]:
			if r != dr:
				ok = False
	if not ok:
		print('NO')
	else:
		print('YES')
		print(str(dr + 1) + ' ' + str(dc + 1))
elif dr == -1 and dc == -1:
	if len(rows) > 2 or len(cols) > 2:
		print('NO')
	else:
		print('YES')
		rs = list(rows.keys())
		cs = list(cols.keys())
		if len(rows) == 0 and len(cols) == 0:
			print('1 1')
		elif len(rows) == 1:
			print(str(cols[cs[0]][0] + 1) + ' 1')
		else:
			r = min(cols[cs[0]][0], cols[cs[1]][0])
			if r == rs[0]:
				c = rows[rs[1]][0]
			else:
				c = rows[rs[0]][0]
			print(str(r + 1) + ' ' + str(c + 1))
else:
	if dr == -1:
		g = dc
		src = cols
	else:
		g = dr
		src = rows
	ok = True
	v = -1
	for a in src:
		if a == g:
			continue
		if v == -1:
			v = src[a][0]
		elif src[a][0] != v:
			ok = False
			break
	if not ok:
		print('NO')
	else:
		print('YES')
		if v == -1:
			v = 0
		if dr == -1:
			print(str(v + 1) + ' ' + str(dc + 1))
		else:
			print(str(dr + 1) + ' ' + str(v + 1))


(n, m) = map(int, input().split())
if n == 1 or m == 1:
	print('YES')
	print('1 1')
	exit()
count_2_walls_row = 0
count_diff_col = 0
pos_col = [None] * 2
lines = [None] * n
for i in range(n):
	lines[i] = input()
	if '*' in lines[i]:
		pos = lines[i].index('*')
		if pos not in pos_col:
			count_diff_col += 1
			if count_diff_col == 3:
				print('NO')
				exit()
			pos_col[count_diff_col - 1] = pos
		count = lines[i].count('*')
		if count >= 2:
			count_2_walls_row += 1
			if count_2_walls_row == 2:
				print('NO')
				exit()
count_2_walls_col = 0
for i in range(m):
	count = 0
	for j in range(n):
		if lines[j][i] == '*':
			count += 1
			if count == 2:
				count_2_walls_col += 1
				if count_2_walls_col == 2:
					print('NO')
					exit()
print('YES')
max_wall_row = 0
row = 0
last_row = 0
count_1_wall_row = 0
pos_1_wall_row = [None] * n
for i in range(n):
	count = lines[i].count('*')
	if max_wall_row < count:
		max_wall_row = count
		row = i
		if count >= 2:
			break
	if count == 1:
		pos_1_wall_row[count_1_wall_row] = [i, lines[i].index('*')]
		count_1_wall_row += 1
max_wall_col = 0
col = 0
count_1_wall_col = 0
pos_1_wall_col = [None] * m
for i in range(m):
	count = 0
	pos = 0
	is_found = False
	for j in range(n):
		if lines[j][i] == '*':
			count += 1
			pos = j
			if max_wall_col < count:
				max_wall_col = count
				col = i
			if count == 2:
				is_found = True
				break
	if is_found:
		break
	if count == 1:
		pos_1_wall_col[count_1_wall_col] = [i, pos]
		count_1_wall_col += 1
if max_wall_row == 1 and max_wall_col > 1:
	distinct = [None] * 2
	amount = [0] * 2
	count = 0
	for i in range(count_1_wall_row):
		if pos_1_wall_row[i][1] not in distinct:
			distinct[count] = pos_1_wall_row[i][1]
			count += 1
			if distinct[1] != None:
				break
	for i in range(count_1_wall_row):
		if pos_1_wall_row[i][1] == distinct[0]:
			amount[0] += 1
		else:
			amount[1] += 1
	pos = 0
	if amount[0] > amount[1]:
		pos = 1
	for i in range(count_1_wall_row):
		if pos_1_wall_row[i][1] == distinct[pos]:
			row = pos_1_wall_row[i][0]
elif max_wall_row > 1 and max_wall_col == 1:
	distinct = [None] * 2
	amount = [0] * 2
	count = 0
	for i in range(count_1_wall_col):
		if pos_1_wall_col[i][1] not in distinct:
			distinct[count] = pos_1_wall_col[i][1]
			count += 1
			if distinct[1] != None:
				break
	for i in range(count_1_wall_col):
		if pos_1_wall_col[i][1] == distinct[0]:
			amount[0] += 1
		else:
			amount[1] += 1
	pos = 0
	if amount[0] > amount[1]:
		pos = 1
	for i in range(count_1_wall_col):
		if pos_1_wall_col[i][1] == distinct[pos]:
			col = pos_1_wall_col[i][0]
elif max_wall_row == max_wall_col == 1 and count_diff_col == 2:
	row = pos_1_wall_row[0][0]
	col = pos_1_wall_row[1][1]
print(row + 1, col + 1)


gi = lambda : list(map(int, input().strip().split()))
(n, m) = gi()
g = [list(input()) for e in range(n)]
gv = [[g[k][j] for k in range(n)] for j in range(m)]
l = [e.count('*') for e in g]
c = [e.count('*') for e in gv]
s = sum(l)
for k in range(n):
	for j in range(m):
		err = 1 if g[k][j] == '*' else 0
		if l[k] + c[j] - err == s:
			print('YES')
			print(k + 1, j + 1)
			exit()
print('NO')


(n, m) = map(int, input().split())
rows = [0] * n
columns = [0] * m
table = []
walls = 0
for y in range(n):
	row = input()
	for (x, ch) in enumerate(row):
		if ch == '*':
			rows[y] += 1
			columns[x] += 1
			walls += 1
	table.append(row)
ok = False
for y in range(n):
	for x in range(m):
		if rows[y] + columns[x] + (-1 if table[y][x] == '*' else 0) == walls:
			print('YES')
			print(y + 1, x + 1)
			ok = True
			break
	if ok:
		break
if not ok:
	print('NO')


(n, m) = map(int, input().split())
bombs = 0
cols = [0 for x in range(m)]
rows = [0 for x in range(n)]
lines = []
for i in range(n):
	line = input()
	lines.append(line)
	for j in range(m):
		if line[j] == '*':
			bombs = bombs + 1
			cols[j] = cols[j] + 1
			rows[i] = rows[i] + 1
if bombs > n + m - 1:
	print('NO')
	exit()
for i in range(n):
	for j in range(m):
		if lines[i][j] == '*':
			if rows[i] + cols[j] - 1 == bombs:
				print('YES')
				print('%d %d' % (i + 1, j + 1))
				exit()
		elif rows[i] + cols[j] == bombs:
			print('YES')
			print('%d %d' % (i + 1, j + 1))
			exit()
print('NO')


(n, m) = map(int, input().split())
A = []
for i in range(n):
	s = input()
	X = [char for char in s]
	A.append(X)
tot = 0
for i in range(n):
	for j in range(m):
		if A[i][j] == '*':
			tot += 1
row = []
col = []
for i in range(n):
	row.append(A[i].count('*'))
t_A = list(zip(*A))
for j in range(m):
	col.append(t_A[j].count('*'))
count = 0
ok = False
for i in range(n):
	if ok == True:
		break
	for j in range(m):
		count = row[i] + col[j]
		if A[i][j] == '*':
			count -= 1
		if count == tot:
			ok = True
			print('YES')
			print(str(i + 1) + ' ' + str(j + 1))
		if ok == True:
			break
if ok == False:
	print('NO')


(row, col) = list(map(int, input().split()))
a = []
x = [0] * row
y = [0] * col
for i in range(row):
	s = input()
	a.append(s)
total = 0
for i in range(row):
	for j in range(col):
		if a[i][j] == '*':
			x[i] += 1
			y[j] += 1
			total += 1
for i in range(row):
	for j in range(col):
		if x[i] + y[j] - (a[i][j] == '*') == total:
			print('YES')
			print(i + 1, j + 1)
			return
print('NO')


(sizeI, sizeJ) = map(int, input().split())
a = [input() for _ in range(sizeI)]
cntRow = [row.count('*') for row in a]
cntCol = [col.count('*') for col in zip(*a)]
cnt = sum(cntRow)
for i in range(sizeI):
	for j in range(sizeJ):
		dead = cntRow[i] + cntCol[j] - (a[i][j] == '*')
		if dead == cnt:
			print('YES\n%d %d' % (i + 1, j + 1))
			exit()
print('NO')


import sys
input = sys.stdin.readline
print = sys.stdout.write

def main():
	(n, m) = map(int, input().split())
	(arr, have, dpx, dpy, cnt) = ([0] * n, set(), [0] * n, [0] * m, 0)
	for i in range(n):
		arr[i] = input().rstrip()
		for j in range(m):
			if arr[i][j] == '*':
				(dpx[i], dpy[j], cnt) = (dpx[i] + 1, dpy[j] + 1, cnt + 1)
	for i in range(n):
		for j in range(m):
			if dpx[i] + dpy[j] - (arr[i][j] == '*') == cnt:
				(print('YES\n{0} {1}'.format(i + 1, j + 1)), exit(0))
	print('NO')
main()


from functools import reduce
(n, m) = map(int, input().split())
g = [input() for i in range(n)]
r = [sum([int(x == '*') for x in R]) for R in g]
c = [sum([int(x == '*') for x in C]) for C in zip(*g)]
cnt = sum(r)
for i in range(n):
	for j in range(m):
		if r[i] + c[j] - (g[i][j] == '*') == cnt:
			print('YES\n' + str(i + 1) + ' ' + str(j + 1))
			exit(0)
print('NO')


from collections import Counter
(n, m) = map(int, input().split())
walls = {}
xs = []
ys = []
for i in range(n):
	row = input()
	for j in range(m):
		if row[j] == '*':
			walls[i, j] = ':blobcosyandcomfy:'
			xs.append(i)
			ys.append(j)
xcount = Counter(xs)
ycount = Counter(ys)
for i in range(n):
	for j in range(m):
		c = xcount[i] + ycount[j]
		if walls.get((i, j)):
			c -= 1
		if c == len(xs):
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


(n, m) = map(int, input().split())
s = [input() for i in range(n)]
row = [0] * n
col = [0] * m
bom = 0
for i in range(n):
	for j in range(m):
		row[i] += s[i][j] == '*'
		col[j] += s[i][j] == '*'
		bom += s[i][j] == '*'
for i in range(n):
	for j in range(m):
		if row[i] + col[j] - (s[i][j] == '*') == bom:
			print('YES')
			print(i + 1, j + 1)
			exit()
print('NO')


[n, m] = [int(x) for x in input().split()]
s = [input() for x in range(n)]
fr = fc = sr = sc = r1 = c1 = r2 = c2 = r = c = -1
b1 = b2 = True
ra = [0 for x in range(n)]
ca = [0 for x in range(m)]
q = 0
for i in range(n):
	for j in range(m):
		if s[i][j] == '*':
			q += 1
			if fr == -1:
				fr = i
				fc = j
			elif sr == -1:
				sr = i
				sc = j
				r1 = fr
				c1 = sc
				r2 = sr
				c2 = fc
				if r1 == r2:
					r = r1
				if c1 == c2:
					c = c1
			elif r == -1:
				if c == -1:
					if i == r1:
						r = r1
						c = c1
					if i == r2:
						r = r2
						c = c2
					if j == c1:
						c = c1
						r = r1
					if j == c2:
						c = c2
						r = r2
					if i != r1 and i != r2 and (j != c1) and (j != c2):
						print('NO')
						exit()
				elif j != c:
					r = i
			elif c == -1:
				if i != r:
					c = j
			elif i != r and j != c:
				print('NO')
				exit()
print('YES')
if q == 0:
	print(1, 1)
elif q == 1:
	print(fr + 1, fc + 1)
elif q == 2:
	print(fr + 1, sc + 1)
elif r == -1:
	print(1, c + 1)
elif c == -1:
	print(r + 1, 1)
else:
	print(r + 1, c + 1)