Harryxun/stf_run huggingface dataset:
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit


if True:
    N, = getIntList()
    #print(N)
    za = getIntList()
 

dprint('begin')

zleft = [0 for i in range(N+1)]
zright = [0 for i in range(N+1)]


def getwork(zr, za):
    zr[0] = 0
    st = []
    for i in range(N):
        if i%10000  ==0:
            dprint('---', i)
        nt = [[za[i],0], [za[i],0], 1]
        st.append(nt)
        nr = zr[i]
        #dprint(st)
        while len(st)>1:
            b_2 = st[-2][1][1]
            b_1 = st[-1][0][1]
            bb = min(b_1,b_2)
            b_1 -=bb
            b_2 -=bb
            b_1p = 4 ** b_1
            b_2p = 4 ** b_2
            t2 = st[-2][1][0] * b_2p
            t1 = st[-1][0][0] * b_1p
            if  t2 < t1:
                nr+= 2* st[-2][2]
                st[-2][0][1] +=1
                st[-2][1][1] +=1
            elif t2 < t1 * 4:
                ttt = [ st[-2][0], st[-1][1], st[-2][2] + st[-1][2] ]  
                st[-2] = ttt
                st.pop()
            else:
                break
        #dprint(st)
        zr[i+1] = nr
        #dprint(nr)
        #dprint(st)
        assert nr < 1000000000000000
    dprint(st)
getwork(zleft, za)
dprint('!!!!')
getwork(zright, za[::-1])
 
#dprint(zleft)
#dprint(zright)

r =  zright[N]
for i in range(N+1):
    tr =  i + zleft[i] + zright[N-i]
    r = min(r,tr)

print(r)

dprint('end')




### FIXED CODE ###

#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, P = getIntList()
#print(N)
if N==1:
    print(P)
    sys.exit()
r = 1
for  t in range(2,1000003):
    if P%t!=0: continue
    c = 0
    while P%t==0:
        P//=t;
        c+=1
    r *= t ** (c//N)

print(r)
S=input()
print('YNEOS'[sum(map(int,S))%int(s)==0::2])

### FIXED CODE ###

S=input()
print('YNeos'[int(S)%sum(map(int,S))!=0::2])
from collections import deque

n = int(input())
a = list(map(int, input().split()))

order = n%2
ans = deque([])
for i in range(n):
    if i & 1 == order:
        ans.append(a[i])
    else:
        ans.appendleft(a[i])
print(' '.join(ans))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

forward = True
sec, first = [], []
for i in range(n):
    if i%2:
        first.append(a[i])
    else:
        sec.append(a[i])
arr = first[::-1] + sec
if len(first) != len(sec):
    arr = arr[::-1]

for el in arr:
    print(el, end=' ')
a = int(input())
b = int(input())

count = [a+b, a-b, a*b]
print (max(count))

### FIXED CODE ###

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

c=[a+b, a-b, a*b]
print (max(c))
a=int(input())
b=int(input())
c=int(input())
x=int(input())

l=[]
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            l.append(500*i+100*j+50*k)
n=0
for i in range(len(l)):
    if l[i]==x:
        n+=1
print(n)


### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)
import numpy as np
from itertools import combinations
from itertools import permutations
from math import factorial


N = int(input())
a = [list(map(int, input().split())) for _ in range(N)]
print(a)
print(list(permutations(a,3)))
L = np.array(list(permutations(a,3)))
print(L)
cnt = 0
for i, j, k in L:
    cnt += sum(diff**2 for diff in i -j)**.5 + sum(diff**2 for diff in j -k)**.5
print(cnt/len(L))






### FIXED CODE ###

from itertools import permutations
from math import sqrt, pow, factorial

N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]

def calc(a, b):
    [x1, y1] = a
    [x2, y2] = b
    return sqrt(pow(x1 - x2, 2) + pow(y1 -y2, 2))
ans = 0
for order in permutations(range(N)):
    tmp = 0
    for i in range(1, N):
        tmp += calc(l[order[i]], l[order[i-1]])
    ans += tmp
print(ans/factorial(N))
import sys
input = sys.stdin.readline
import numpy as np

N, W = [int(item) for item in input().split()]
item = np.array([[int(item) for item in input().split()] for _ in range(N)])

dp = np.zeros((N+1, W+1), dtype='int64')

for i in range(N):
    dp[i+1] = dp[i]
    w, v = item[i]
    np.maximum(dp[i][w:], dp[i][:-w] + v, out=dp[i+1][w:])
    #print(dp)

print(np.max(dp))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np

N, W = [int(item) for item in input().split()]
item = np.array([[int(item) for item in input().split()] for _ in range(N)])


dp = np.full((N+1, 10**5 + 1), 10**12+1)
dp[0][0] = 0

for i in range(N):
    dp[i+1] = dp[i]
    w, v = item[i]
    np.minimum(dp[i][v:], dp[i][:-v] + w, out=dp[i+1][v:])

print(np.where(dp[N] <= W)[0][-1])
import sys
N = int(input())
arr = list(map(int, input().split()))
if N == 2:
    print(0)
    sys.exit(0)


def update(start):
    dic = dict()
    for i in range(start, N, 2):
        if arr[i] in dic:
            dic[arr[i]] += 1
        else:
            dic[arr[i]] = 1
    return sorted(dic.items(), key=lambda ele: ele[1], reverse=True)


tuple_1 = update(0)
tuple_2 = update(1)

what_1, mx_1 = tuple_1[0]
what_2, mx_2 = tuple_2[0]

if what_1 == what_2:
    if len(tuple_1) == 1 and len(tuple_2) == 1:
        print(N//2)
    elif len(tuple_1 == 1):
        print(N//2 - tuple_2[1][1])
    elif len(tuple_2 == 1):
        print(N//2 - tuple_1[1][1])
    else:
        ans1 = N - tuple_1[0][1] - tuple_2[1][1]
        ans2 = N - tuple_1[1][1] - tuple_2[0][1]
        print(min(ans1, ans2))
else:
    print(N - mx_1 - mx_2)


### FIXED CODE ###

import sys
N = int(input())
arr = list(map(int, input().split()))
if N == 2:
    print(0)
    sys.exit(0)


def update(start):
    dic = dict()
    for i in range(start, N, 2):
        if arr[i] in dic:
            dic[arr[i]] += 1
        else:
            dic[arr[i]] = 1
    return sorted(dic.items(), key=lambda ele: ele[1], reverse=True)


tuple_1 = update(0)
tuple_2 = update(1)

what_1, mx_1 = tuple_1[0]
what_2, mx_2 = tuple_2[0]

if what_1 == what_2:
    if len(tuple_1) == 1 and len(tuple_2) == 1:
        print(N//2)
    elif len(tuple_1) == 1:
        print(N//2 - tuple_2[1][1])
    elif len(tuple_2) == 1:
        print(N//2 - tuple_1[1][1])
    else:
        ans1 = N - tuple_1[0][1] - tuple_2[1][1]
        ans2 = N - tuple_1[1][1] - tuple_2[0][1]
        print(min(ans1, ans2))
else:
    print(N - mx_1 - mx_2)
n = int(input())
A = list(map(int,input().split()))
Ae = A[0:n:2]
Ao = A[1:n:2]
if n%2==0:
    print(*Ao[::-1],*Ae)
else:
    print(*Ae[::-1],*Ao)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
Ae = A[0:n:2]
Ao = A[1:n:2]
if n%2==0:
    B = Ao[::-1]+Ae
    print(*B)
else:
    B = Ae[::-1]+Ao
    print(*B)
import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if N==1:
    print(1)
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0

if a[-1][0]-1==a[-2][0]:
    li.append(a[-1][1]+a[-2][1])
print(max(li))

### FIXED CODE ###

import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if len(a)==1:
    print(a[0][1])
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0

if a[-1][0]-1==a[-2][0]:
    li.append(a[-1][1]+a[-2][1])
print(max(li))
import collections as c
ip = lambda : map(int, input().split())
# ##############
N = int(input())
l = list(ip())
d = []
for i in range(N-1):
    d.append(l[i+1]-l[i])

ans = 0;mod = 1e9+7;c=0;l=1
for i in range(N-1):
    # if i == 0:
    #     c = 1
    # else:
    #     c = (c*(i+1)/(i*l) + 1)*l
    # print(ans)
    # ans = (ans*(i+1)%mod + d[i]*c)%mod
    # l = (l*i+1)%mod
    c+=1/(i+1)
    ans += c*d[i]
    ans%=mod
    l *= i+1
print(int(ans*l%mod))

### FIXED CODE ###

import collections as c
ip = lambda : map(int, input().split())
# ##############
N = int(input())
l = list(ip())
d = []
for i in range(N-1):
    d.append(l[i+1]-l[i])

ans = 0
mod = int(1e9+7)
c=0
l=1
for i in range(N-1):
    c = ((i+1)*c + l)%mod
    ans = ((i+1)*ans + c*d[i])%mod
    l = l*(i+1)%mod
print(ans)
N,M = map(int, input().split())
res = [0]
for i in range(N):
    K = list(map(int, input().split()))
    for j in K:
        res[K-1] = 1
print(M-res.count(0))

### FIXED CODE ###

N,M = map(int, input().split())
res = [0]*M
for i in range(N):
    A = list(map(int, input().split()))
    K = A[0]
    for j in range(1,K+1):
        res[A[j]-1] += 1
print(res.count(N))
M = 10**9 + 7
L = 200000
 
Fm = {}
inverseFm = {}
x = 1
for i in range(L):
    Fm[i] = x
    x = x * (i + 1) % M
 
def inverseFm(x):
    result = pow(Fm[x], M - 2, M)
    return result
 
def C(n, r):
    result = Fm[n] * inverseFm(r) * inverseFm(n - r) % M
    return result
 
def solve(H, W, A, B):
    result = 0
    for i in range(B + 1, W + 1):
        result += C(i + H - A - 1 - 1, i - 1) * C(W - i + A - 1, W - i)
    return result % M
 
H, W, A, B = [int(_) for _ in input().split()]
 
print(solve(H, W, A, B))


### FIXED CODE ###

ABC = [int(_) for _ in input().split()]

if sorted(ABC) == [5, 5, 7]:
    print("YES")
else:
    print("NO")
a = int(input())
b = int(input())

product = a * b

if product % 2 == 0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

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

if a*b%2:
    print('Odd')
else:
    print('Even')
n,m = map(int,input().split())
a = list(input())
a[k-1] = chr(ord(a[k-1]) + ord(a)-ord('A'))
print(''.join(a))

### FIXED CODE ###

n,k = map(int,input().split())
a = list(input())
a[k-1] = chr(ord(a[k-1]) + ord('a') - ord('A'))
print(''.join(a))
from collections import Counter
input()
c = Counter([min(int(i)//400,8) for i in input().split()])
lt3200 = [bool(c[i]) for i in range(8)].count(True)
print(max(1, lt3200), lt3200+d[8])

### FIXED CODE ###

N =int(input())
scores = [min(int(i)//400, 8) for i in input().split()]
d = [0]*9
for s in scores:
    d[s] = d[s] + 1
lt3200 = [bool(i) for i in d[:8]].count(True)
m = max(1, lt3200)
M = lt3200+d[8]
print('{} {}'.format(m, M))
a = input()
b = 3 * (a ** a)
 
print (b)

### FIXED CODE ###

r = int(input())
print(3*r*r)
# -*- coding: utf-8 -*-
import numpy as np

def main():
    a=int(input())
    b=int(input())
    c=max(a,b)
    print(c+(c-1))

if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

def main():
    i=list(map(int, input().split()))
    coin=0
    if (i[0]<i[1]):
        coin =coin+i[1]
        i[1] =i[1]-1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    if (i[0] < i[1]):
        coin = coin + i[1]
        i[1] = i[1] - 1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    print(coin)

if __name__ == '__main__':
    main()
n=int(input())
w=[int(x) for x in input().split()]
ans='Yes'
for i in range(1,n):
  if w[i-1][-1]!=w[i][0]:
    ans='No'
    break
  for j in range(i):
    if w[i]==w[j]:
      ans='No'
      break
print(ans)


### FIXED CODE ###

n=int(input())
w=[input() for _ in range(n)]
ans='Yes'
for i in range(1,n):
  if w[i-1][-1]!=w[i][0]:
    ans='No'
    break
  for j in range(i):
    if w[i]==w[j]:
      ans='No'
      break
print(ans)
import sys

def read_data():
  n=input()
  x=[]
  for i in range(10):
    x.append(map(int,raw_input().split()))
  return n, x

def is_area3(x,y):
  if x>7 or y>5: return False
  for dx in [0,1,2,1,0]:
    A=P[y][x-dx:x+dx+1]
    if A.count(0)>0: return False
    y+=1
  return True
      
def is_area2(x,y):
  if x>7 or y>7: return False
  for dy in [0,1,2]:
    A=P[y+dy][x:x+3]
    if A.count(0)>0: return False
  return True

def is_area1(x,y):
  if x>8 or y>7: return False
  for dx in [0,1,0]:
    A=P[y][x-dx:x+dx+1]
    if A.count(0)>0: return False
    y+=1
  return True

def ink(x,y,s,m):
  global P
  dx = [0,1,-1,0,0,1,1,-1,-1,2,-2,0,0]
  dy = [0,0,-0,1,-1,1,-1,1,-1,0,0,2,-2]
  for i in range([5,9,13][s-1]):
    P[y+dy[i]][x+dx[i]]+=m
  return

drops,P = read_data()
A=[]
i=-1
m=3
while i<99:
  i+=1
  y=i/10
  x=i%10
  if P[y][x]==0: continue

  if m==3:
    while is_area3(x,y):
      A.append([x,y,3])
      ink(x,y+2,3,-1)
    if P[y][x]==0:
      m=3
      continue
    else: m=2

  if m==2:
    while is_area2(x,y):
      A.append([x,y,2])
      ink(x+1,y+1,2,-1)
    if P[y][x]==0:
      m=3
      continue
    else: m=1

  if m==1:
    while is_area1(x,y):
      A.append([x,y,1])
      ink(x,y+1,1,-1)
    if P[y][x]==0:
      m=3
      continue
    else: m=0

  dx=[0,1,0]
  dy=[1,1,2]
  if m==0 and len(A)>0:
    x,y,m=A.pop()
    m-=1
    ink(x+dx[m],y+dy[m],m+1,1)
    i = y*10+x-1
  else:
    break

if drops <=12 and len(A)==drops:
  for x,y,s in A: print x+dx[s-1],y+dy[s-1],s

### FIXED CODE ###

def read_data():
  n=input()
  x=[]
  for i in range(10):
    x.append(map(int,raw_input().split()))
  return n, x
 
def is_area3(x,y):
  if x>7 or y>5: return False
  for dx in [0,1,2,1,0]:
    A = P[y][x-dx:x+dx+1]
    if A.count(0)>0: return False
    y += 1
  return True
       
def is_area2(x,y):
  if x>7 or y>7: return False
  for dy in [0,1,2]:
    A = P[y+dy][x:x+3]
    if A.count(0)>0: return False
  return True
 
def is_area1(x,y):
  if x>8 or y>7: return False
  for dx in [0, 1, 0]:
    A = P[y][x-dx:x+dx+1]
    if A.count(0)>0: return False
    y += 1
  return True
 
def ink(x,y,s,m):
  global P
  dx = [0,1,-1,0,0,1,1,-1,-1,2,-2,0,0]
  dy = [0,0,-0,1,-1,1,-1,1,-1,0,0,2,-2]
  for i in range([5,9,13][s-1]):
    P[y+dy[i]][x+dx[i]]+=m
  return
 
drops, P = read_data()
M=[]
i=-1
step =3
while i<99:
  i+=1
  y = i / 10
  x = i % 10
  if P[y][x]==0: continue
 
  if step==3:
    while is_area3(x,y):
      M.append([x,y,3])
      ink(x,y+2,3,-1)
    if P[y][x]==0:
      step = 3
      continue
    else: step = 2
 
  if step==2:
    while is_area2(x,y):
      M.append([x,y,2])
      ink(x+1,y+1,2,-1)
    if P[y][x]==0:
      step = 3
      continue
    else: step = 1
 
  if step==1:
    while is_area1(x,y):
      M.append([x,y,1])
      ink(x,y+1,1,-1)
    if P[y][x]==0:
      step = 3
      continue
    else: step = 0
 
  dx=0
  dy=1
  if step==0 and len(M)>0:
    x,y,tmp = M.pop()
    if tmp==3: dy=2
    elif tmp==2: dx=1
    ink(x+dx,y+dy,tmp,1)
    i = y*10+x-1
    step = tmp-1
  else: break
if drops <=12 and len(M)==drops:
  for x,y,s in M:
    dx=0
    dy=1
    if s==3: dy=2
    elif s==2: dx=1
    print x+dx,y+dy,s
from collections import Counter
N,A,B = map(int,input().split())
src = list(map(int,input().split()))
src.sort(reverse=True)

ave = sum(src[:A]) / A
print(ave)

counter = Counter(src)
cnt = counter[src[0]]

ncr = [[1]]
for n in range(1,N+1):
    ncr.append([1])
    for r in range(1,n):
        ncr[n].append(ncr[n-1][r-1] + ncr[n-1][r])
    ncr[n].append(1)

if cnt < A:
    last = src[A-1]
    n = counter[last]
    r = src[:A].count(last)
    print(ncr[n][r])
elif cnt == A:
    print(1)
else:
    ans = 0
    for r in range(A,B+1):
        ans += ncr[cnt][r]
    print(ans)


### FIXED CODE ###

from collections import Counter
N,A,B = map(int,input().split())
src = list(map(int,input().split()))
src.sort(reverse=True)

ave = sum(src[:A]) / A
print(ave)

counter = Counter(src)
cnt = counter[src[0]]

ncr = [[1]]
for n in range(1,N+1):
    ncr.append([1])
    for r in range(1,n):
        ncr[n].append(ncr[n-1][r-1] + ncr[n-1][r])
    ncr[n].append(1)

if cnt < A:
    last = src[A-1]
    n = counter[last]
    r = src[:A].count(last)
    print(ncr[n][r])
elif cnt == A:
    print(1)
else:
    ans = 0
    for r in range(A, min(B,cnt)+1):
        ans += ncr[cnt][r]
    print(ans)
a=(int)(input()-input());print(a>0 and'GREATER'or a<0 and'LESS'or'EQUAL')

### FIXED CODE ###

a=(int)(input())-(int)(input());print(a>0 and'GREATER'or a<0 and'LESS'or'EQUAL')
ais = sorted(map(int, raw_input()).split())
print 'Yes' if sum(ais[:2]) == ais[2] else 'No'

### FIXED CODE ###

ais = sorted(map(int, raw_input().split()))
print 'Yes' if sum(ais[:2]) == ais[2] else 'No'
N = int(input())

hoge = []

if N % 2 != 0:
    purint(0)
else:
    for i in range(1, 19):
        hoge.append(N // 10**i)
    print(sum(hoge))


### FIXED CODE ###

N = int(input())

hoge = []

if N % 2 != 0:
    print(0)
else:
    for i in range(1, 40):
        hoge.append((N // 10)  // (5 ** i))
    print(sum(hoge) + (N // 10))
import fractions
def main():
    N, M = map(int, input().split())
    a = tuple(map(int, input().split()))
    s = a[0]
    s2 = max(a)
    s3 = 0
    while True:
        if s2 % 2 == 0:
            s2 /= 2
            s3 +=1
        else:
            break
    for i in a:
        if i % (2 ** s3) != 0:
            print(0)
            return 0
    for i in range(1,N):
        s = s * a[i] // fractions.gcd(s, a[i])
    s /= 2
    a = int(M // (2*s))
    if (M // s) % 2 == 0:
        print(a)
    else:
        print(a+1)
main()



### FIXED CODE ###

import fractions
def main():
    N, M = map(int, input().split())
    a = tuple(map(int, input().split()))
    s = a[0]
    s2 = a[0]
    s3 = 0
    while True:
        if s2 % 2 == 0:
            s2 /= 2
            s3 +=1
        else:
            break
    if s3 == 0:
        print(0)
        return 0
    for i in a:
        if i % (2 ** s3) != 0:
            print(0)
            return 0
        elif i % (2 ** (s3 + 1)) == 0:
            print(0)
            return 0
    for i in range(1,N):
        s = s * a[i] // fractions.gcd(s, a[i])
        if s > M*2:
            print(0)
            return 0
    s /= 2
    a = int(M // (2*s))
    if (M // s) % 2 == 0:
        print(a)
    else:
        print(a+1)
main()
def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        s[b-1] = '#'
        flg = True
        for i in range(len(s)):
            if s[i] == s[i+1] and s[i] == '#':
                flg = False
                break
        if flg:
            print('Yes')
            return
        flg = True
        s[b-1] = '.'
        s[d-1] = '#'
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                flg = False
                break
        if flg:
            print('Yes')
            return

        for i in range(a-1,c-3):
            if s[i] == s[i+1] == s[i+2] and s[i] == '.':
                print('Yes')
                return

        print('No')

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No')



if __name__ == '__main__':
    main()
import math
A,B,H,M = map(float, input().split())
rate = M / 60.0
HM = H*5.0 + 10.0*rate
theta = abs(HM-M) * 6.0
if theta > 180:
    theta = 360-theta
#rad = math.radians(theta)
#cos = abs(math.cos(rad))
L = math.sqrt(A**2 + B**2 - 2*A*B*abs(math.cos(math.radians(theta))))
if H==0 and M ==0:
    L = 0
print("{:.19f}".format(L))

### FIXED CODE ###

N = int(input())
if (N % 10 == 3):
	print("bon")
elif (N % 10 ==0 or N % 10 ==1 or N % 10 ==6 or N % 10 ==8):
	print("pon")
else:
	print("hon")
a, b, c = map(int, input.split())
if (b >= c):
  print(b+c)
else:
  tot = 0
  tot += 2*b
  c -= b
  tot += c if a >= c-1 else a+1
  print(tot)

### FIXED CODE ###

a, b, c = map(int, input().split())
if (b >= c):
  print(b+c)
else:
  tot = 0
  tot += 2*b
  c -= b
  tot += c if a >= c-1 else a+1
  print(tot)
import sys
import numpy as np

read = sys.stdin.read
N, M, *A = map(int, read().split())
A = np.array(A, np.int64)

a = A[None, :] + A[:, None]
a = a.flatten()

a.sort()
print(a[-M:].sum())

### FIXED CODE ###

import sys
import numpy as np

read = sys.stdin.read
N, M, *A = map(int, read().split())

A.sort()
A_as = np.array(A, np.int64)
A_rev = np.array(A[::-1], np.int64)
a = A_rev.cumsum()
a_max = a[-1]

left = 0
right = A[-1] * 2 + 1
while right - left > 1:
    mid = (right + left) // 2
    n = N - np.searchsorted(A_as, mid - A_as)
    n[n < 0] = 0
    m = n.sum()
    if m >= M:
        left = mid
    else:
        right = mid

threshold = left

n = N - np.searchsorted(A_as, threshold - A_as, side='right')
n[n < 0] = 0
answer = a[n[n > 0] - 1].sum() + (A_as * n).sum()
if n.sum() != M:
    answer -= threshold * (n.sum() - M)

print(answer)
x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x)
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)

### FIXED CODE ###

x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x):
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)