Harryxun/stf_run huggingface dataset:
H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]

count = [0]
def dfs(x, y):
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      count[0] += 1
      continue
    if nx >= W or ny >= H:
      continue
    if field[ny][nx] == "#":
      continue
    dfs(nx, ny)

dfs(0,0)
print(count[0])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]
MOD = 10 ** 9 + 7
count = [0]
dp = [[-1] * W for _ in range(H)]

def dfs(x, y):
  ret = 0
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      ret += 1
      continue
    elif nx >= W or ny >= H:
      continue
    elif dp[ny][nx] > -1:
      ret += dp[ny][nx]
      continue
    elif field[ny][nx] == "#":
      continue
    else:
      ret += dfs(nx, ny)
  dp[y][x] = ret % MOD
  return ret

dfs(0,0)
print(dp[0][0])
n=int(input())
h=list(map(int,input().split()))
if n==1:
  print("Yes")
else:
  l=0
  s="Yes"
  for i in range(n):
    if h[i]>=l:
      l=h[i]
    if l-h[i]>=2:
      s="No"
      break
print(s)

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
if n==1:
  print("Yes")
else:
  l=0
  s="Yes"
  for i in range(n):
    if h[i]>=l:
      l=h[i]
    if l-h[i]>=2:
      s="No"
      break
  print(s)
YOUBI = input()
if YOUBI == "MON":
  print"6"
if YOUBI == "TUE":
  print"5"
if YOUBI == "WED":
  print"4"
if YOUBI == "THU":
  print"3"
if YOUBI == "FRI":
  print"2" 
if YOUBI == "SAT":
  print"1"
if YOUBI == "SUN":
   print"7"
    
    
   

### FIXED CODE ###

YOUBI = input()
if YOUBI == "MON":
  print(6)
if YOUBI == "TUE":
  print(5)
if YOUBI == "WED":
  print(4)
if YOUBI == "THU":
  print(3)
if YOUBI == "FRI":
  print(2) 
if YOUBI == "SAT":
  print(1)
if YOUBI == "SUN":
   print(7)
N=int(input())
sum=0
for i range(N):
  l, r =map(int,input().split())


### FIXED CODE ###

n=int(input())
sum=0
for i in range(n):
  l, r =map(int, input().split())
  sum+=(r-l+1)
print(sum)
a,b,c=input()

if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and a!=b:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c=input().split()

if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and a!=b:
    print("Yes")
else:
    print("No")
import sys
from collections import defaultdict
from itertools import accumulate

input = sys.stdin.readline

N, K = map(int, input().split())
sushi = defaultdict(list)
for i in range(N):
    t, d = map(int, input().split())
    sushi[t].append(d)

X, Y = [], []
for v in sushi.values():
    v = sorted(v, reverse=True)
    X.append(v[0])
    if len(v) > 1:
        Y += v[1:]
X = sorted(X, reverse=True)

X = [0] + [x for x in accumulate(X)]
Y = [0] + [x for x in accumulate(Y)]

ans = 0
for i in range(1, K + 1):
    j = K - i
    if j < len(Y):
        ans = max(ans, X[i] + Y[j] + i * i)
print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict
from itertools import accumulate

input = sys.stdin.readline

N, K = map(int, input().split())
sushi = defaultdict(list)
for i in range(N):
    t, d = map(int, input().split())
    sushi[t].append(d)

X, Y = [], []
for v in sushi.values():
    v = sorted(v, reverse=True)
    X.append(v[0])
    if len(v) > 1:
        Y += v[1:]
X = sorted(X, reverse=True)
Y = sorted(Y, reverse=True)

X = [0] + [x for x in accumulate(X)]
Y = [0] + [x for x in accumulate(Y)]

ans = 0
for i in range(1, min(len(X), K + 1)):
    j = K - i
    if j < len(Y):
        ans = max(ans, X[i] + Y[j] + i * i)
print(ans)
a = input()
b = [int(c) for c in a]

d = len(a)
e = b + 1
i = 0
while i < e:
    e = a[i]
    if e == '7':
        print('Yes')
        break
    elif e == a:
          print('No')
        
    i += 1

### FIXED CODE ###

a = input()
if '7' in a:
   print('Yes')
else:
   print('No')
from math import gcd
n, X = [int(i) for i in input().split()]
x = [abs(int(i) - X) for i in input().split()]
ans = 0
for i in x:
    ans = gcd(ans, i)
print(ans)

### FIXED CODE ###

from fractions import gcd
n, X = [int(i) for i in input().split()]
x = [abs(int(i) - X) for i in input().split()]
ans = 0
for i in x:
    ans = gcd(ans, i)
print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N, W = map(int, readline().split())
    weight = [0 for _ in range(110)]
    value = [0 for _ in range(110)] 
    for i in range(N):
        w, v = map(int, readline().split())
        weight[i] = w
        value[i] = v
    dp = [[0 for _ in range(110)] for _ in range(10**5+100)]
    for i in range(N):
        for sum_w in range(W+1):
            if sum_w - weight[i] >= 0:
                dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w-weight[i]] + value[i]) 
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])
    print(dp[N][W])
if __name__ == '__main__':
    main()


### FIXED CODE ###


def main():
    n, w = map(int, input().split())
    weight = [0 for _ in range(110)]
    value = [0 for _ in range(110)]

    for i in range(n):
        x, y = map(int, input().split())
        weight[i] = x
        value[i] = y

    
    dp = [[0 for _ in range(110000)] for i in range(110)]

    for i in range(n):
        for sum_w in range(w+1):
            if sum_w - weight[i] >= 0:
                dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - weight[i]] + value[i])
            
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

    print(dp[n][w]) 

main()
import sys

argv=sys.argv

x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]

print(max(y))

### FIXED CODE ###

x=input().split()

for i in range(2):
    x[i]=int(x[i])

y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))
a,b = list(map(input().split()))
if a == "H" and b == "H":
    print("H")
elif a == "D" and b == "D":
    print("H")
else:
    print("D")

### FIXED CODE ###

a,b = list(input().split())
if a == "H" and b == "H":
    print("H")
elif a == "D" and b == "D":
    print("H")
else:
    print("D")
def read():
	return [int(i) for i in input().split(" ")]
N = int(input())
T = read()
A = read()
t = [(i != j, i) for i, j in zip(T, [None] + T)]
a = [(i != j, i) for i, j in zip(A, (A + [None])[1:])]
P = 1
for p, q in zip(t, a):
	if(p[0]):
		if(q[0]):
			if(p[1] != q[1]):
				print(0)
				exit()
		else:
			if(q[1] < p[1]):
				print(0)
				exit()
	elif(q[0]):
		if(p[1] < q[1]):
			print(0)
			exit()
	else:
		P = P * min(p[1], q[1]) % (10 ** 9 + 7))
print(P) 


### FIXED CODE ###

def read():
	return [int(i) for i in input().split(" ")]
N = int(input())
T = read()
A = read()
t = [(i != j, i) for i, j in zip(T, [None] + T)]
a = [(i != j, i) for i, j in zip(A, (A + [None])[1:])]
P = 1
for p, q in zip(t, a):
	if(p[0]):
		if(q[0]):
			if(p[1] != q[1]):
				print(0)
				exit()
		else:
			if(q[1] < p[1]):
				print(0)
				exit()
	elif(q[0]):
		if(p[1] < q[1]):
			print(0)
			exit()
	else:
		P = P * min(p[1], q[1]) % (10 ** 9 + 7)
print(P)
alphabet = "abcdefghijklmnopqrstuvwxyz"


n = int(input())
res = dict()
for _ in range(n):
  s = str(input())
  freqency = [0 for _ in alphabet]
  for __ in s:
    freqency[alphabet.index(__)] += 1
    freq = "".join(freqency)
    if freq not in res:
      res[freq] = 1
    else:
      res[freq] += 1

ans = 0
for value in res.values():
  ans += ((value-1)*value)/2
  
print(ans)

### FIXED CODE ###

alphabet = "abcdefghijklmnopqrstuvwxyz"


n = int(input())
res = dict()
for _ in range(n):
    s = str(input())
    freqency = [0 for _ in alphabet]
    for __ in s:
        freqency[alphabet.index(__)] += 1
    freq = "".join([str(___) for ___ in freqency])
    if freq not in res:
        res[freq] = 1
    else:
        res[freq] += 1

ans = 0
for value in res.values():
    ans += ((value-1)*value)/2
  
print(int(ans))
n = int(input())
c = [-1] + [int(input()) for i in range(n)]

count = [0]*(n+2)
dp = [0]*(n+1)
dp[0] = 1
mod = 10**9+7
#dp[i]: i番目までの場合の数
for i in range(n):
    dp[i+1] = dp[i]
    if c[i+1] != c[i]:
        dp[i+1] += count[c[i+1]]
        dp[i+1] %= mod
    count[c[i+1]] += dp[i]
    count[c[i+1]] %= mod

print(dp[n])


### FIXED CODE ###

n = int(input())
c = [-1] + [int(input()) for i in range(n)]

count = [0]*(200005)
dp = [0]*(n+1)
dp[0] = 1
mod = 10**9+7
#dp[i]: i番目までの場合の数
for i in range(n):
    dp[i+1] = dp[i]
    if c[i+1] != c[i]:
        dp[i+1] += count[c[i+1]]
        dp[i+1] %= mod
        count[c[i+1]] += dp[i]
        count[c[i+1]] %= mod

print(dp[n]%mod)
A, B, C, D = map(int, input().split())
while 1:
  C -= B
  if C <= 0:
    print('Yes')
    break
  A -= D
  if A < 0:
     print('No')
     break

### FIXED CODE ###

S, W = map(int, input().split())

if S <= W :
  print('unsafe')
else :
  print('safe')
input_data = input()
if input_data <= 999:
    print(str(ABC))
else:
    print(str(ABD))

### FIXED CODE ###

input_data = int(input())
if input_data <= 999:
    print('ABC')
else:
    print('ABD')
n = int(input())
l = []
for i in range(0, n):
    l.append(int(input()))
print(len(set(l)))

### FIXED CODE ###

s = input()
print(s.replace('2017','2018'))
res=[]
s=True
while s:
    s=input()
    if s:
        a,b = [int(x) for x in s.split()]
        res.append(a+b)

for n in res:
    print(len(str(n))+1)

### FIXED CODE ###

res=[]

while 1:
    try:
        s=input()
        a,b = [int(x) for x in s.split()]
        res.append(a+b)
    except:
        for n in res:
            print(len(str(n)))
        break
S = str(input())

c = 0
ma = 0
for i in S:
    c = 0
    for k,j in enumerate(S):
        if ( k != 0 and k != N-1 and j != i and S[k-1] != a and S[k+1] != a):
            c += 1
    ma = min(ma, c)

print(ma)




### FIXED CODE ###

def check(s, S):
    for i in S:
        if (i != s):
            return True
    return False

S = str(input())
T = S

m = 1000
for s in S:
    num = 0
    T = S
    while (check(s, T)):
        num += 1
        K = []
        for i in range(0, len(T) - 1):
            if s == T[i+1]:
                K.append(T[i+1])
            else:
                K.append(T[i])
        T = K
    m = min(m, num)

print(m)
import sys
sys.setrecursionlimit(10**7)


n=int(input())

s=input()
x=int(s,2)
ans=[]

ans_memo=[0]*(2**(n+2))
#print(ans_memo)
#ans_memo[1]=1
#ans_memo[2]=1

def DEF(x,cnt):
    global ans_memo
    #print(x,cnt,ans_memo)
    if ans_memo[x]!=0:
        return ans_memo[x]
    else:
        if x%(str(bin(x)).count("1"))==0:
            ans_memo[x]=1
            return 1
        else:
            tmp=DEF(x%(str(bin(x)).count("1")),cnt+1)+1
            ans_memo[x]=tmp
            return tmp

ans=[]

for i in range(n):
    tmp=2**(n-i-1)
    tmp_num=x

    #1の時
    if tmp&tmp_num:
        tmp_num-=tmp
        ans.append(DEF(tmp_num,0))
        
    else:
        tmp_num+=tmp
        ans.append(DEF(tmp_num,0))

#print(ans_memo)

for item in ans:
    print(item)
            









### FIXED CODE ###

def popcount(x):
    return bin(x).count("1")

n=int(input())
s=input()
X=int(s,2)

one_cnt=popcount(X)

modp=X%(one_cnt+1)
modm=X%(one_cnt-1) if one_cnt-1!=0 else 0

for i in range(n):
    if s[i]=="1":
        if one_cnt-1==0:
            print(0)
            continue
        else:
            num=(modm-pow(2,n-i-1,one_cnt-1))%(one_cnt-1)
    else:
        num=(modp+pow(2,n-i-1,one_cnt+1))%(one_cnt+1)

    #print(i,"num",num)
    cnt=1
    while num!=0:
        num=num%popcount(num)
        cnt+=1
    print(cnt)
n, m = map(int, input().split())
mod = 10**9+7
facs = [1] * (n-m)
invs = [1] * (n-m)
nfac = 1
for i in range(1, n-m):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod)

ans = 1
start = 0
for i in range(m+1):
    try:
        a = int(input())
        end = a-1
    except:
        end = n
    if start-1 == end:
        print(0)
        break
    # startからendまで行く方法
    t = end-start
    pat = 0
    for j in range(-(-t//2)+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    ans *= pat
    ans %= mod
    start = a+1
else:
    print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
mod = 10**9+7
facs = [1] * (n-m+1)
invs = [1] * (n-m+1)
nfac = 1
for i in range(1, n-m+1):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod)

ans = 1
start = 0
def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod

for i in range(m):
    a = int(input())
    end = a-1
    if start == end+1:
        print(0)
        break
    # startからendまで行く方法
    ans *= steps(start, end)
    ans %= mod
    start = a+1
else:
    ans *= steps(start, n)
    ans %= mod
    print(ans)
N = int(input())

cost = 1
xy_set = []
for i in range(N):
    x, y = map(int, input().split())
    xy_set.append((x, y))
xy_set_sorted = sorted(xy_set, key=lambda a: a[0])

xy_sub_set = {}
for i in range(1, N):
    xs = xy_set_sorted[i][0] - xy_set_sorted[i-1][0]
    ys = xy_set_sorted[i][1] - xy_set_sorted[i - 1][1]
    if xy_sub_set.get((xs, ys)) is None:
        xy_sub_set[(xs, ys)] = 1
    else:
        xy_sub_set[(xs, ys)] += 1

xy_sub_set_sorted = sorted(xy_sub_set.items(), key=lambda a: a[1], reverse=True)
print(cost + (N-1) - xy_sub_set_sorted[0][1])

### FIXED CODE ###

N = int(input())


def solve():

    initial_cost = 1

    # (x,y) list
    xy_list = []
    for i in range(N):
        x, y = map(int, input().split())
        xy_list.append((x, y))
    xy_list_sorted = sorted(xy_list, key=lambda a: a[0])

    if N == 1 or N == 2:
        return initial_cost

    xy_sub_dic = {}
    for i in range(N):
        for j in range(N):
            xs = xy_list_sorted[j][0] - xy_list_sorted[i][0]
            ys = xy_list_sorted[j][1] - xy_list_sorted[i][1]
            if xs != 0 or ys != 0:
                if xy_sub_dic.get((xs, ys)) is None:
                    xy_sub_dic[(xs, ys)] = 1
                else:
                    xy_sub_dic[(xs, ys)] += 1

    xy_sub_dic_sorted = sorted(xy_sub_dic.items(), key=lambda a: a[1], reverse=True)

    return initial_cost + (N - 1) - xy_sub_dic_sorted[0][1]
print(solve())
import math
import collections
import itertools
import heapq
import bisect
import sys


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    c = [0] * 40
    res = 0
    for a in A:
        for bit in range(40):
            if a & (1<<bit):
                c[k] += 1

    x = 0
    for k in range(39,-1,-1):
        if x + (1<<k) > K:
            continue
        if c[k] <= N // 2:
            x += (1<<k)

    for a in A:
        res += x^a

    print(res)
  

if __name__ == "__main__":
    main()

### FIXED CODE ###

import math
import collections
import itertools
import heapq
import bisect
import sys


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    c = [0] * 40
    res = 0
    for a in A:
        for bit in range(40):
            if a & (1<<bit):
                c[bit] += 1

    x = 0
    for k in range(39,-1,-1):
        if x + (1<<k) > K:
            continue
        if c[k] <= N // 2:
            x += (1<<k)

    for a in A:
        res += x^a

    print(res)
  

if __name__ == "__main__":
    main()
s = input()
print(s.count(1))
		
  	


### FIXED CODE ###

s = input()
print(s.count("1"))
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)

def search(field,distance,ch,cv,eh,ev,step):
	if not (0<=ch<len(field)):		return
	if not (0<=cv<len(field[ch])):	return
	if field[ch][cv]=='X':			return
	if distance[ch][cv]<step: 		return

	distance[ch][cv] = step
	search(field,distance,ch+1,cv,eh,ev,step+1)
	search(field,distance,ch-1,cv,eh,ev,step+1)
	search(field,distance,ch,cv+1,eh,ev,step+1)
	search(field,distance,ch,cv-1,eh,ev,step+1)

def calculate_distance(field,locations,current_HP):
	ch,cv=locations[current_HP-1]
	eh,ev=locations[current_HP]
	distance=[[10**6 for _ in range(len(field[0]))] for __ in range(len(field))]
	search(field,distance,ch,cv,eh,ev,0)
#	print('='*50)
#	for v in distance:
#		print(v)
#	print('-'*50)
	return distance[eh][ev]
#	return 0

def solve(field,locations):
	total_step=0
	for current_HP in range(1,len(locations)):
		total_step += calculate_distance(field,locations,current_HP)
	return total_step

def main():
	line=input().strip()
	H,W,N=list(map(int,line.split(' ')))
	field,locations=list(),dict()
	for i in range(H):
		field.append(list(input().strip()))
		for j,x in enumerate(field[-1]):
			if x=='S':
				locations[0] = (i,j,)
			if x.isdigit():
				x = int(x)
				field[-1][j] = x
				locations[x] = (i,j,)
	print(solve(field,locations))

if __name__=='__main__':
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

def get_shortest_distance(field,locations,current_HP):
	is_visit = [[False for _ in range(len(field[0]))] for __ in range(len(field))]
	frontier = list([locations[current_HP-1]])
	for step in range(len(field)*len(field[0])):
		next_frontier = set()
		for cx,cy in frontier:
			for dx,dy in [[0,1],[0,-1],[1,0],[-1,0]]:
				nx, ny = cx+dx, cy+dy
				if (nx,ny)==locations[current_HP]: return step+1
				if not (0<=nx<len(field)):		continue
				if not (0<=ny<len(field[nx])):	continue
				if field[nx][ny]=='X':			continue
				if is_visit[nx][ny]: 			continue
				next_frontier.add((nx,ny))
				is_visit[nx][ny] = True
		frontier = next_frontier

def solve(field,locations):
	total_step=0
	for current_HP in range(1,len(locations)):
		total_step += get_shortest_distance(field,locations,current_HP)
	return total_step

def main():
	line=input().strip()
	H,W,N=list(map(int,line.split(' ')))
	field,locations=list(),dict()
	for i in range(H):
		field.append(list(input().strip()))
		for j,x in enumerate(field[-1]):
			if x=='S':
				locations[0] = (i,j,)
			if x.isdigit():
				x = int(x)
				field[-1][j] = x
				locations[x] = (i,j,)
	print(solve(field,locations))

if __name__=='__main__':
	main()
m=int(input())
d=[]
c=[]
for i in range(m):
    a,b=map(int,input().split())
    d.append(a)
    c.append(b)
p=[0]*10
for i in range(m):
    p[d[i]]+=c[i]
ans=0
def ika(x,y):
    ret=0
    z=x*y
    ret+=y-1
    while z>9:
        s=list(str(z))
        ret+=len(s)-1
        for i in range(len(s)):
            s[i]=int(s[i])
        z=sum(s)
    return [ret,z]
ka=[]
for i in range(m):
    f=ika(d[i],c[i])
    ans+=f[0]
    ka.append(f[1])
print(ans+ika(sum(ka),1)+len(ka-1))


### FIXED CODE ###

m=int(input())
d=[]
c=[]
z=0
for i in range(m):
    a,b=map(int,input().split())
    d.append(a)
    c.append(b)
    z+=a*b
ans=0
print(sum(c)-1+(z-1)//9)
exit()
def ika(x,y):
    ret=0
    z=x*y
    ret+=y-1
    while z>9:
        s=list(str(z))
        ret+=len(s)-1
        i5=0
        for i in range(len(s)):
            s[i]=int(s[i])
        g=0
        while g<len(s)-1:
            if s[g]+s[g+1]>=10:
                #ret+=1
                g+=2
            else:
                g+=1
        z=sum(s)
        ret+=(z-10)//10
    return [ret,z]
ka=[]
for i in range(m):
    f=ika(d[i],c[i])
    ans+=f[0]
    ka.append(f[1])
print(ans+ika(sum(ka),1)[0]+len(ka)-1)
A, B, K = map(int, input().split())
l = list(range(A, B+1))
print(*sorted(set(l[:K] + l[-K:])), sep='\n')

### FIXED CODE ###

A, B, K = map(int, input().split())
K = min(K, B - A + 1)
print(*sorted(set([i for i in range(A, A+K)] + [i for i in range(B-K+1, B+1)])), sep='\n')
n=int(input())
ans=0
for i in range(n):
    a,b=map(int,input().split())
    if(n%2==0 and i==n//2-1):
        ans=b-a+2
    if(n%2!=0 and i==n//2):
        ans=b-a+1
print(ans)
        

### FIXED CODE ###

from fractions import Fraction
a,b=map(Fraction,input().split())
print(int(a*b))
A,B=list(map(int,input.split()))
print((A-1)*(B-1) + )

### FIXED CODE ###

A,B=list(map(int,input().split()))
print((A-1)*(B-1))
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)
print(ans)

### FIXED CODE ###

print(input().count("1"))
N = int(input())
t=0
x=0
y=0
for i in range(N)
    nt, nx, ny = map(input().split())
    km = abs(nx-x) + abs(ny-y)
    if km > (nt-t) or (km - (nt-t)) % 2 = 1:
        print("No")
        exit(0)
    t, x, y = nt, nx, ny
print("Yes")


### FIXED CODE ###

t, x, y = 0, 0, 0
for i in range(int(input())):
    next_t, next_x, next_y = map(int, input().split())
    diff = abs(x - next_x) + abs(y - next_y)
    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1:
        print("No")
        exit(0)
    t, x, y, = next_t, next_x, next_y
print("Yes")
# ｎとｍの取得
data = input().split()
n = int(data[0]) #n == 人数
m = int(data[1]) #m == 数字の種類
ans = 0
#ｎ回データを取得してカウント

j = 1 #j == 好きな数字
i = 1 #i == 行数カウンタ
c = [0] * m #c == ある数が含まれているかのカウンタ　0で初期化
    #データの取得

while i <= n:
    tmp = input()
    td = tmp[1:] #td == 好きな番号
    tn = tmp[0]  #tn == 好きな番号の数
    print(td)
    # 数字が含まれているかの比較
    while j <= m: # jがすべての数字について実行
        j = str(j)# jを文字列に変換
        if j in td: # jがｔｄに含まれるかの分岐
            j = int(j) #　ｊを数値に戻す
            c[j] += 1 # ｃのｊ番目の要素にカウント
        j = int(j) #if ではじかれたとき用にｊを数値に戻す
        j += 1# ｊをカウント
    j = 1    
    i += 1 # iをカウント

# 全てに含まれている数字の集計

for x in c:
    if x == n:
        ans += 1

print(c)

print(ans)


### FIXED CODE ###

# ｎとｍの取得
data = input().split()
n = int(data[0]) #n == 人数
m = int(data[1]) #m == 数字の種類
ans = 0
#ｎ回データを取得してカウント

j = 1 #j == 好きな数字
i = 1 #i == 行数カウンタ
c = [0] * (m  *2)#c == ある数が含まれているかのカウンタ　0で初期化
    #データの取得

while i <= n:
    tmp = [int(s) for s in input().split()]
    td = tmp[1:] #td == 好きな番号
    tn = tmp[0]  #tn == 好きな番号の数
    
    # 数字が含まれているかの比較
    while j <= m: # jがすべての数字について実行
        
        if j in td: # jがｔｄに含まれるかの分岐
            j = int(j) #　ｊを数値に戻す
            
            c[j] += 1 # ｃのｊ番目の要素にカウント
        j = int(j) #if ではじかれたとき用にｊを数値に戻す
        j += 1# ｊをカウント
    j = 1    
    i += 1 # iをカウント

# 全てに含まれている数字の集計

for x in c:
    if x == n:
        ans += 1



print(ans)
import math
tl, ta, al, aa = map(int, input().split(" ")
print("Yes" if math.ceil(al/ta) < math.ceil(tl / aa) else "No")

### FIXED CODE ###

import math
tl, ta, al, aa = map(int, input().split(" "))
print("Yes" if math.ceil(al/ta) - 1 < math.ceil(tl / aa) else "No")
s = input()

def drop(s):
    if s[0] != 'A':
        return drop(s[1:])
    if s[-1] != 'Z':
        return drop(s[:-1])
    return s

print(len(drop(s)))



### FIXED CODE ###


s = input()

while True:
    if s[0] != 'A':
        s = s[1:]
        continue
    if s[-1] != 'Z':
        s = s[:-1]
        continue
    break

print(len(s))
s = input()
n = len(s)

f = 0
for i in range(s):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")


### FIXED CODE ###

s = input()
n = len(s)

f = 0
for i in range(n):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")