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: interview

Starter code:

Solutions:
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 = 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')


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)
                return
    print("NO")
    
main()

#!/usr/bin/env pypy3

import array
import itertools

IMPOSSIBLE = (-1, -1)


def place_bomb(height, width, is_wall):
    # zero-based
    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(list(range(height)), list(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:
            # one-based
            return (bomb_r + 1, bomb_c + 1)
    else:
        return IMPOSSIBLE


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


def __starting_point():
    main()

__starting_point()

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')

            
    


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 = list(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)
            return
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

# transpose string arrays
str_t = list(zip(*str_l))

# find column contains max number of walls
for _ in range(y):
    walls = str_t[_].count('*')
    if walls > max_cv:
        max_c = _
        max_cv = walls

# find row contains max number of walls
for _ in range(x):

    walls = str_l[_].count('*')

    if walls > max_rv:
        max_r = _
        max_rv = walls

    # if number same, then do a smart row choice
    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

    # remove from column
    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)
        return

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')


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;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)), return

    print("NO")


main()


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], y[j], c = 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{0} {1}".format(i + 1, j + 1));return
p("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")


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")


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")


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
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")


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=""),return) if x[i]+y[j]-(a[i][j]=="*")==c else 0 for j in r(m) for i in r(n)];p("NO")


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()

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 ) )


row,col = map(int,input().split())
a = []
for i in range(row):
    s = input()
    a.append(s)

x = [i.count("*") for i in a]
#print(x)

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]
#print(y)

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)
            return
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")


row,col = map(int,input().split())
a = []
for i in range(row):
    s = input()
    a.append(s)

x = [i.count("*") for i in a]
#print(x)

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]
#print(y)

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)
            return
print("NO")

def main():
    n, m = list(map(int, input().split()))
    xx, yy, 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
                xx[x] += 1
                yy[y] += 1
    for x, a in enumerate(xx):
        t = len(walls) - a
        for y, b in enumerate(yy):
            if b - ((x, y) in walls) == t:
                print("YES")
                print(x + 1, y + 1)
                return
    print("NO")


def __starting_point():
    main()

__starting_point()

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")


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(1e9+7)
eps=1e-6
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)
            return
print("NO")