Harryxun/stf_run huggingface dataset:
#import sys
#input = sys.stdin.buffer.readline

def main():
    S = str(input())
    five = ["dream","erase"]
    def dream(s):
        if len(s) == 0:
            return True
        elif len(s) < 5:
            return False
        else:
            if s[:5] not in five:
                return False
            else:
                if s[:5] == "dream":
                    sf = s[5:]
                    if s[:7] == "dreamer":
                        se = s[7:]
                        return (dream(sf) or dream(se))
                    else:
                        return dream(sf)
                if s[:5] == "erase":
                    sf = s[5:]
                    if s[:6] == "eraser":
                        ss = s[6:]
                        return (dream(sf) or dream(ss))
                    else:
                        return dream(sf)
                
    if dream(S):
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline
sys.setrecursionlimit(20000+1)

def main():
    s = "".join(list(reversed(str(input()))))
    b = True
    
    while len(s) != 0:
        if len(s) >= 5:
            use = ["maerd","esare"]
            if s[:5] in use:
                s = s[5:]
            elif (len(s) >= 6 and s[:6] == "resare"):
                s = s[6:]
            elif (len(s) >= 7 and s[:7] == "remaerd"):
                s = s[7:]
            else:
                b = False
                break
        else:
            b = False
            break
            
    if b:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()
n=int(input())
p=list(map(int, input().split()))
def chk(i, cnt, m):
  if p[i]==1:
    return cnt+1
  elif i==n-1: 
    return cnt
  else:
    if p[i]<=m:
      return chk(i+1, cnt+1, p[i])
    else:
      return chk(i+1, cnt, m)
if p[0]==1:
  print(1)
else:
  print(chk(1, 1, p[0]))

### FIXED CODE ###

n=int(input())
p=list(map(int, input().split()))
ans=0
m=p[0]
for i in p:
  if i<=m:
    m=i
    ans+=1
print(ans)
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))
A = sum(A);B = sum(B)
count = 0
total = B-A
for i,j in zip(a,b):
    if i < j:
        count += (j-i+1)//2
    else:
        count += i-j
if count <= total:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))
A = sum(a);B = sum(b)
count_1 = 0
count_2 = 0
total = B-A
for i,j in zip(a,b):
    if i < j:
        count_1 += (j-i+1)//2
    else:
        count_2 += i-j
count = max(count_1,count_2)
if count <= total:
    print("Yes")
else:
    print("No")
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 10**9 + 7

N, A, B = map(int, read().split())

if A > B:
    A, B = B, A

dp1 = np.zeros((N, B), dtype=np.int64)  # その時点で確定している長さ集計
dp2 = np.zeros((N, B), dtype=np.int64)  # もし右に十分な 0 があったとしたときの、長さ集計
dp1_sum = np.zeros(N, dtype=np.int64)

ans = 0
for n in range(N):
    # そこで初めての 1 がたつ場合
    if n + 1 < B:
        if n >= A:
            dp1[n, n + 1] += 1
        else:
            dp1[n, 1] += 1
    # ひとつ手前から 1 を立てて遷移した場合
    dp1[n, 1:] += dp1[n - 1, :-1]
    dp1[n] %= MOD
    # 使えない個数の 0 をはさんで遷移した場合
    if n >= A:
        dp1[n, 1] += dp1_sum[n - A:n - 1].sum() % MOD
    # たくさんの個数の 0 をはさんで遷移した場合
    if n >= A + 1:
        dp1[n, A + 1:B] += dp2[n - A - 1, 0:B - (A + 1)]
    dp1[n] %= MOD
    # 右を 0 埋めして足せるなら答に足す
    dp1_sum[n] = dp1[n].sum() % MOD
    if (N - n - 1) < A:
        ans += dp1_sum[n]
        ans %= MOD
    else:
        # あと N - n - 1 のびても B にならないような範囲
        M = B - (N - n - 1)
        if M > 0:
            ans += dp1[n, :M].sum() % MOD
    dp2[n] += dp1[n]
    dp2[n, 1:] += dp2[n - 1, :-1]
    dp1[n] %= MOD
    dp2[n] %= MOD

x = pow(2, N, MOD) - ans
print(x % MOD)

### FIXED CODE ###

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 10**9 + 7

N, A, B = map(int, read().split())

def solve(N, A, B):
    if A > B:
        A, B = B, A
    if A == 1:
        return pow(2, N, MOD)
    dp1 = np.zeros((N, B), dtype=np.int64)  # その時点で確定している長さ集計
    dp2 = np.zeros((N, B), dtype=np.int64)  # もし右に十分な 0 があったとしたときの、長さ集計
    dp1_sum = np.zeros(N, dtype=np.int64)
    ans = 0
    for n in range(N):
        # そこで初めての 1 がたつ場合
        if n < A:
            dp1[n, 1] += 1
        else:
            if n + 1 < B:
                dp1[n, n + 1] += 1
        # ひとつ手前から 1 を立てて遷移した場合
        if n > 0:
            dp1[n, 1:] += dp1[n - 1, :-1]
        # 使えない個数の 0 をはさんで遷移した場合
        dp1[n, 1] += dp1_sum[max(0, n - A):n - 1].sum() % MOD
        # たくさんの個数の 0 をはさんで遷移した場合
        if n >= A + 1 < B:
            dp1[n, A + 1:B] += dp2[n - A - 1, 0:B - (A + 1)]
        dp1[n] %= MOD
        # 右を 0 埋めして足せるなら答に足す
        dp1_sum[n] = dp1[n].sum() % MOD
        if (N - n - 1) < A:
            ans += dp1_sum[n]
            ans %= MOD
        else:
            # あと N - n - 1 のびても B にならないような範囲
            M = B - (N - n - 1)
            if M > 0:
                ans += dp1[n, :M].sum() % MOD
        dp2[n] += dp1[n]
        dp2[n, 1:] += dp2[n - 1, :-1]
        dp1[n] %= MOD
        dp2[n] %= MOD
    x = pow(2, N, MOD) - ans
    return x % MOD

print(solve(N, A, B))
a,b,c=sorted(map(int,input().split()))

if a == b+c;
	print("Yes")
else:
	print("No")

### FIXED CODE ###

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

if a == b+c or b == a+c or c == a+b:
	print("Yes")
else:
	print("No")
n = input()
if n % 2 == 0:
  return 1/2
else:
  return (n/2 + 0.5)/n


### FIXED CODE ###

n = int(input())
if n % 2 == 0:
  print(1/2)
else:
  print((n/2 + 0.5)/n)
N,K = map(int,input().split())
A = list(map(int,input().split()))
for k in range(K):
    imos = [0] * (N+1)
    for i,a in enumerate(A):
        l = max(0, i-a)
        r = min(N, i+1+a)
        imos[l] += 1
        imos[r] -= 1
    imos[0] = min(N, imos[0])
    for i in range(N):
        imos[i+1] = min(N, imos[i] + imos[i+1])
    A = imos[:-1]
    if A[0] == A[-1] == N
        break
print(*A)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
for k in range(K):
    imos = [0] * (N+1)
    for i,a in enumerate(A):
        l = max(0, i-a)
        r = min(N, i+1+a)
        imos[l] += 1
        imos[r] -= 1
    imos[0] = min(N, imos[0])
    for i in range(N):
        imos[i+1] = min(N, imos[i] + imos[i+1])
    A = imos[:-1]
    if all(a==N for a in A):
        break
print(*A)
#DP D
n,W=map(int,input().split())
wv=[list(map(int,input().split())) for _ in range(n)]
dp=[[0]*(W+1) for _ in range(n+1)]
for i in range(n):
    w,v=wv[i]
    for j in range(W+1):
        if j<w:
            dp[i+1][j]=dp[i][j]
        else:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w]+v)
for i in range(n+1):
print(dp[-1][-1])

### FIXED CODE ###

#DP D
n,W=map(int,input().split())
wv=[list(map(int,input().split())) for _ in range(n)]
dp=[[0]*(W+1) for _ in range(n+1)]
for i in range(n):
    w,v=wv[i]
    for j in range(W+1):
        if j<w:
            dp[i+1][j]=dp[i][j]
        else:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w]+v)
print(dp[-1][-1])
N = int(input())
adj = [[] for n in range(N)]
for i in range(N-1):
  a, b = [int(n)-1 for n in input().split()]
  adj[a].append(b)
  adj[b].append(a)



def dfs(now, cost, dic):
  dic[now] = cost
  for nx in adj[now]:
    if nx not in dic:
      dfs(nx, cost+1, dic)

dist_f = {}
dist_s = {}

dfs(0, 0, dist_f)
dfs(N-1, 0, dist_s)


f_cnt = 0
for  i in range(N):
  if dist_f[i] <= dist_s[i]:
    f_cnt += 1

if f_cnt >= N-f_cnt:
  print("Fennec")
else:
  print("Snuke")

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N = int(input())
adj = [[] for n in range(N)]
for i in range(N-1):
  a, b = [int(n)-1 for n in input().split()]
  adj[a].append(b)
  adj[b].append(a)



def dfs(now, cost, dic):
  dic[now] = cost
  for nx in adj[now]:
    if nx not in dic:
      dfs(nx, cost+1, dic)

dist_f = {}
dist_s = {}

dfs(0, 0, dist_f)
dfs(N-1, 0, dist_s)


f_cnt = 0
for  i in range(N):
  if dist_f[i] <= dist_s[i]:
    f_cnt += 1

if f_cnt > N-f_cnt:
  print("Fennec")
else:
  print("Snuke")
from functools import lru_cache

@lru_cache(None)
def dfs(p, remain):

    n = len(arr)

    if remain == 0 or p >= n:
        return 0

    if remain == 1:
        return max(arr[p:])
        
    len_remain = n - (p + 1)

    t = -float('inf')
    if (remain - 1) * 2 + 1 <= len_remain:
        t = dfs(p + 1, remain)

    t2 = arr[p] + dfs(p + 2, remain - 1)

    return max(t, t2)

    


n = int(input())

arr = list(map(int, input().split()))

ans = dfs(0, n // 2)

print (ans)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

from functools import lru_cache

@lru_cache(None)
def dfs(p, remain):

    n = len(arr)

    if remain == 0 or p >= n:
        return 0

    if remain == 1:
        return max(arr[p:])
        
    len_remain = n - (p + 1)

    t = -float('inf')
    if (remain - 1) * 2 + 1 <= len_remain:
        t = dfs(p + 1, remain)

    t2 = arr[p] + dfs(p + 2, remain - 1)

    return max(t, t2)

    


n = int(input())

arr = list(map(int, input().split()))

ans = dfs(0, n // 2)

print (ans)
n,a=map(int,input().split())
x=list(map(int,input()))
stack=[0]*5001
stack[2500-a]=1
ans=0
for i in x:
  i-=a
for i in x:
  ans+=stack[2500-i+a]
  stack2=[i for i in stack]
  for j in range(5001):
    if 0<=j+i<=5000:
      stack2[j+i]+=stack[j]
  stack=[i for i in stack2]
print(stack[2500])

### FIXED CODE ###

n,a=map(int,input().split())
x=list(map(int,input().split()))
stack=[0]*5001
stack[2500]=1
ans=0
for i in range(len(x)):
  x[i]-=a
for i in x:
  ans+=stack[2500-i]
  stack2=[i for i in stack]
  for j in range(5001):
    if 0<=j+i<=5000:
      stack2[j+i]+=stack[j]
  stack=[i for i in stack2]
print(stack[2500]-1)
N, K = map(int, input().split())
a = list(map(int, input().split()))
s = [sum([b > c for c in a]) for b in a]
l = [sum([l < a[i] for l in a[:i]]) for i in range(1, len(a))]
l.insert(0, 0)
r = [[b - c for b, c in zip(s, l)]]
a = sum(r) * (1+K)*K/2 + sum(l) * (K-1)*K/2
print(int(a)%(1e9+7))


### FIXED CODE ###

MAX = 10**9 + 7
_, K = map(int, input().split())
a = list(map(int, input().split()))
s = [sum([b > c for c in a]) for b in a]
r = [sum([b > c for c in a[i:]]) for i, b in enumerate(a)]
b = sum(s)*(K-1)*K//2%MAX
print((b+sum(r)*K)%MAX)
import heapq
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
d={}
l,q=[],[]
for i in a:
    if i in d: d[i]+=1
    else: d[i]=1

for i in d: heapq.heappush(q, i)

for i in range(m):
    b,c=map(int,input().split())
    l.append((c,b))
l.sort(reverse=True)
for c,b in l:
    if c<=q[0]: break
    while b:
        x=min(b,d[q[0]])
        if c in d:
            d[c]+=x
        else:
            d[c]=x
        b-=x
        d[q[0]]-=x
        if d[q[0]]==0:
            heapq.heappop(q)
ans=0
for i in d:
    ans+=i*d[i]
print(ans)

### FIXED CODE ###

import heapq
def sol():
    n,m=map(int,input().split())
    a=[int(i) for i in input().split()]
    d={}
    w=[]
    q=[]
    for i in a:
        if i in d:
            d[i]+=1
        else:
            d[i]=1
            w.append(i)
    for i in w: heapq.heappush(q, i)
    for i in range(m):
        b,c=map(int,input().split())
        while b:
            if c>q[0]:
                x=min(b,d[q[0]])
                if c in d:
                    d[c]+=x
                    b-=x
                    d[q[0]]-=x
                    if d[q[0]]==0:
                        heapq.heappop(q)
                else:
                    d[c]=x
                    b-=x
                    d[q[0]]-=x
                    heapq.heappush(q,c)
                    if d[q[0]]==0:
                        heapq.heappop(q)
            else:
                break
    ans=chk=0
    for i in d:
        ans+=i*d[i]
    print(ans)

if __name__=="__main__":
    sol()
import copy as cp
n,k = map(int,input().split())
lamps = list(map(int,input().split()))
for j in range(k):
    lamplog = [0]*n
    lamp_io = [0]*n
    for i in range(len(lamps)):
        if(i == 0):
            lamplog[i]=[0,lamps[i]]
        elif(i == n-1):
            lamplog[i]=[n-(lamps[i]+1) ,n-1]
        else:
            lamplog[i]= [max(i-lamps[i],0),min(i+lamps[i],n-1)]
    for i in range(len(lamplog)):
        for l in range(lamplog[i][1]-lamplog[i][0]+1):
            lamp_io[lamplog[i][0]+l]+=1
    # print(lamplog)
    lamps = cp.copy(lamp_io)
ans = ""
for i in range(len(lamp_io)):
    ans += str(lamps[i]) +" "
print(ans.rstrip())

### FIXED CODE ###

from numba import jit
@jit
def main():
    n,k = map(int,input().split())
    lamps = list(map(int,input().split()))
    for ki in range(k):
        lamplog = [0]*(n+1)
        for i in range(n):
            lamplog[max(0,i-lamps[i])  ] += 1   #先端を出す
            lamplog[min(i+lamps[i]+1,n)] -= 1   #末尾を出す
        # print(lamplog)
        for i in range(n):                      #累積和を計算
            lamplog[i+1] += lamplog[i]
        # print(lamplog)
        lamplog.pop()
        if(lamplog == lamps):                   #１つ前の結果と今回の結果が同じだったら。
            break
        lamps = lamplog                         #今回の結果を記録
    return lamplog

lamplog = main()
ans = ""
for i in range(len(lamplog)):
    ans += str(lamplog[i]) +" "
print(ans.rstrip())
N = int(input())
W = [int(i) for i in input().split()]

ans = sum(W)
s = ans
t = 0
for i in range(N):
  s -= W[i]
  t += W[i]
  ans = min(abs(s-t))
  
print(ans)

### FIXED CODE ###

N = int(input())
W = [int(i) for i in input().split()]

ans = sum(W)
s = ans
t = 0
for i in W:
  s -= i
  t += i
  ans = min(abs(s-t), ans)
  
print(ans)
N = input()
print("Yes" if n[0]==n[1]==n[2] or n[1]==n[2]==n[3])

### FIXED CODE ###

n = input()
print("Yes" if n[0]==n[1]==n[2] or n[1]==n[2]==n[3] else "No")
n = int(input())
a = [int(input()) for i in range(n)]
for i in a:
  if i == 1:
    print("first")
    exit()
xor = a[0]
for i in range(1,n):
  xor ^= a[i]
if xor %2 == 0:
  assert n == 10**5 and xor == 0 and a[0] > 50000
  print("second")
else:
  print("first")



### FIXED CODE ###

n,p = map(int,input().split())
import math
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n //= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff
so = factorization(p)
ans = 1
for i,j in so:
    ans *= i**(j//n)
print(ans)
import math
# a: 時
# b: 分
# 
a, b, h, m = map(int, input().split())


x　=　( a**2　+　b**2　−　2 * a * b * math(int(360 / h) * 30) + int(360 / m) * 6 ) ** 0.5
print(x)


### FIXED CODE ###

import math
# a: 時
# b: 分
# 
a, b, h, m = map(int, input().split())

angle_h = h * 30 + m * 0.5
angle_m = m * 6

cos_ = math.cos( math.radians( abs( angle_h - angle_m ) ) )

x = ( a**2 + b**2 - 2*a*b*cos_ ) ** 0.5

print(x)
from pprint import pprint
import heapq

def solve(n, a, b):
    b_pq = []
    b_rev = {}
    for i, b_i in enumerate(b):
        if b_i == a[i]:
            a.pop(i)
            continue
        heapq.heappush(b_pq, (-1 * b_i, i))

    count = 0
    while b_pq:
        tmp = heapq.heappop(b_pq)
        # pprint(tmp)
        b_i = tmp[0] * -1
        i_b = tmp[1]
        # print(i_b, b_i)
        i_a = (i_b - 1 + n) % n
        i_c = (i_b + 1) % n
        b_cand = b_i
        if b_cand - b[i_a] - b[i_c] < a[i_b]:
            continue

        #while b_cand - b[i_a] - b[i_c] >= a[i_b]:
        #    b_cand = b_cand - b[i_a] - b[i_c]
        #    count += 1
        tmp_count =  (b_cand - a[i_b]) // (b[i_a] + b[i_c])
        b_cand -= (b[i_a] + b[i_c]) * tmp_count
        count += tmp_count

        b[i_b] = b_cand
        heapq.heappush(b_pq, (-1 * b_cand, i_b))
        # print("count: ", count)
        # pprint(b)
        if b_cand == a[i_b] and b == a:
            return count
    
    return -1


if __name__ == '__main__':

    n = int(input().strip())
    a = list(map(int, input().strip().split(" ")))
    b = list(map(int, input().strip().split(" ")))
    print(solve(n, a, b))

### FIXED CODE ###

from pprint import pprint
import heapq

def solve(n, a, b):
    b_pq = []
    b_rev = {}
    delete = []
    for i, b_i in enumerate(b):
        if b_i == a[i]:
            continue
        heapq.heappush(b_pq, (-1 * b_i, i))

    count = 0
    while b_pq:
        tmp = heapq.heappop(b_pq)
        # pprint(tmp)
        b_i = tmp[0] * -1
        i_b = tmp[1]
        # print(i_b, b_i)
        i_a = (i_b - 1 + n) % n
        i_c = (i_b + 1) % n
        b_cand = b_i
        if b_cand - b[i_a] - b[i_c] < a[i_b]:
            continue

        #while b_cand - b[i_a] - b[i_c] >= a[i_b]:
        #    b_cand = b_cand - b[i_a] - b[i_c]
        #    count += 1
        tmp_count =  (b_cand - a[i_b]) // (b[i_a] + b[i_c])
        b_cand -= (b[i_a] + b[i_c]) * tmp_count
        count += tmp_count

        b[i_b] = b_cand
        if b_cand != a[i_b]:
            heapq.heappush(b_pq, (-1 * b_cand, i_b))
        # print("count: ", count)
        # pprint(b)
         

        if b_cand == a[i_b] and b == a:
            return count
    
    return -1


if __name__ == '__main__':

    n = int(input().strip())
    a = list(map(int, input().strip().split(" ")))
    b = list(map(int, input().strip().split(" ")))
    print(solve(n, a, b))
l=input().split()
a,b=map(int,[l[1],l[2]])
n=len(list(l[0]))
total=0
while i in range(1,n+1):
    if a<=i<=b:
        total+=1
        i+=1
else:
    print(total)

### FIXED CODE ###

n,a,b=map(int,input().split())
total=0
i=1
while i in range(1,n+1):
   l=list(str(i))
   ll=[int(s) for s in l]
   if a<=sum(ll)<=b:
        total+=i
        i+=1
   else:
           i=i+1
else:
    print(total)
import collectoins


### FIXED CODE ###

from collections import deque
 
jumps = [
    [1, -2], [0, -2], [-1, -2], [-2, -1], [-2, 0], [-2, 1], [-1, 2], [0, 2], [1, 2], [2, -1], [2, 0], [2, 1]
]
 
def bfs(ipy, ipx, ys, xs, n):
    q = deque()
    q.append([ipy, ipx, -1])
    while q:
        py, px, t = q.popleft()
        if t == n-1:
            return True
 
        for dy, dx in jumps:
            npy = py + dy
            npx = px + dx
            if npy in range(10) and npx in range(10) and abs(npy - ys[t+1]) <= 1 and abs(npx - xs[t+1]) <= 1:
                q.append([npy, npx, t+1])
 
    return False
 
if __name__ == '__main__':
    while True:
        try:
            ipx, ipy = map(int, input().split())
            if ipx == 0 and ipy == 0:
                break
            n = int(input())
            l = list(map(int, input().split()))
            xs = l[::2]
            ys = l[1::2]
             
            if bfs(ipy, ipx, ys, xs, n):
                print('OK')
            else:
                print('NA')
        except:
            break
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a_gap = 0
b_gap = 0
for i in range(n):
    if A[i]>B[i]:
        a_gap+=A[i]-B[i]
    if A[i]<B[i]:
        b_gap+=B[i]-A[i]

if a_gap*2-b_gap>0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a_gap = 0
b_gap = 0
for i in range(n):
    if A[i]>B[i]:
        a_gap+=A[i]-B[i]
    if A[i]<B[i]:
        b_gap+=(B[i]-A[i])//2

if b_gap-a_gap<0:
    print('No')
else:
    print('Yes')
N, X = map(int, input().split())
steps = list(input().split())

x = 0
count = 0

while x < X:
    x += int(steps[int(count)])
    count +=1

print(count)

### FIXED CODE ###

N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)
n = input().split
 
if n[len(n)] == 7:
  print("Yes")
elif n[len(n)- 1] == 7:
  print("Yes")
elif n[len(n)- 2] == 7:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
n = str(n)
  
if n[len(n) - 1] == str("7"):
  print("Yes")
elif n[len(n)- 2] == str("7"):
  print("Yes")
elif n[len(n)- 3] == str("7"):
  print("Yes")
else:
  print("No")
from sys import exit
 
S = str(input())#["F","F","T","F"]
Gx, Gy = [int(n) for n in input().split()]#[4,4]
Xds = []
Yds = []
X = True
L = len(S)
for s in S.split("T"):
    if X:
        Xds.append(len(s))
    else:
        Yds.append(len(s))
    X = not X
# print(Xds)
# print(Yds)
if(len(Xds) != 0):
    memox = [set([Xds[0]])] + [0]*(len(Xds)-1)
else:
    memox = [0]
for i in range(1,len(Xds)):
    can = set()
    for x in memox[i-1]:
        can.add(x+Xds[i])
        can.add(x-Xds[i])
    memox[i]=can
 
if(len(Yds) != 0):
    memoy = [set([Yds[0],-Yds[0]])] + [0]*(len(Yds)-1)
else:
    memoy = [0]
for i in range(1,len(Yds)):
    can = set()
    for y in memoy[i-1]:
        can.add(y+Yds[i])
        can.add(y-Yds[i])
    memoy[i]=can
if Gx in memox[-1] and Gy in memoy[-1]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from sys import exit
from collections import defaultdict
import itertools
# dic = defaultdict(int)
# N = int(input())
# a = [int(input()) for _ in range(N)]
S = str(input())
x,y = [int(n) for n in input().split()]

dx = []
dy = []
X = True
tmp = 0


S = [len(s) for s in S.split("T")]
dx = S[0::2]
dy = S[1::2]
x -= dx[0]
del dx[0]

def check(d, p):
    memo = set([0])
    for t in d:
        memo = {a+b for a,b in itertools.product(memo, [-t, t])}
    return (p in memo)


print("Yes" if check(dx,x) and check(dy,y) else "No")
import fractions
a, b = map(float, input().split())
print(fractions.floor(a*b))


### FIXED CODE ###

from decimal import Decimal
a, b = map(Decimal, input().split())
print(int(a*b))
r, c = [int(i) for i in input().split]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data.append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c * 1):
        sum_row[ci] += data[ri][ci]

print(" ".join([str(s) for s in sum_row]))

from pprint import pprint
pprint(data)
pprint(sum_row)

### FIXED CODE ###

r, c = [int(i) for i in input().split()]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data.append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c + 1):
        sum_row[ci] += data[ri][ci]

print(" ".join([str(s) for s in sum_row]))
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))

for mi in M:
    flg = False
    for i in range(n):
        for j in list(itl.combinations(A, i+1)):
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")



### FIXED CODE ###

import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")
N = int(input())
V = sorted(list(map(int,input().split())))



for i in range(N-1):
    V[0] = (V[0] + V.pop(1))/2

print(V[0])

### FIXED CODE ###

a = int(input())
s = input()

print( s if a >= 3200 else "red")