peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = input()
k = "keyence"

for i in range(len(k) + 1):
    if S[:i] == k[:i] and S[-(len(k) - i):] == k[-(len(k) - i):]:
        print("YES")
        exit()

print("NO")
# Judge status: Accepted
def resolve():
    N = int(input())
    print(N * 800 - (N // 15) * 200)

resolve()
# Judge status: Accepted
## C - Welcome to AtCoder
N ,M = map(int, input().split())
AC = [0] + [0] * N
WA = [0] + [0] * N
for m in range(M):
    p, S = map(str, input().split())
    if S == 'WA' and AC[int(p)] != 1:
        WA[int(p)] += 1
    else:
        AC[int(p)] = 1
print(' '.join([str(x) for x in [sum(AC), sum([WA[i] for i in range(N+1) if AC[i] == 1 ])] ]) )
# Judge status: Accepted
from collections import deque

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())), reverse=True)
q = sorted(list(map(int,input().split())), reverse=True)
r = sorted(list(map(int,input().split())), reverse=True)

p = deque(p[0:x])
q = deque(q[0:y])
r = deque(r)


while len(r) != 0 and min(p[-1],q[-1]) < r[0]:
  if p[-1] < q[-1]:
    p.appendleft(r.popleft())
    p.pop()
  else:
    q.appendleft(r.popleft())
    q.pop()
    
print(sum(p)+sum(q))
# Judge status: Accepted
n = int(input())
u = len(str(n))

if u % 2 == 0:
    print((100**(u//2)-1)//11)
elif u % 2 == 1:
    print((100**((u-1)//2)-1)//11 + n - 10**(u-1) + 1)
# Judge status: Accepted
S,T=input().split()
print(T+S)
# Judge status: Accepted
N,*S = map(int,open(0).read().split())

p = [[False for i in range(100*100+1)]  for j in range(N+1)]

p[0][0] = True

for i in range(N):
    for j in range(100*N+1):
      #S0~Si, point sum is j
      if p[i][j] == True:
        # incorrect
        p[i+1][j] = True
        # correct
        p[i+1][j+S[i]] = True 

for i in range(100*N, -1, -1):
  if p[N][i] == True and i % 10 != 0:
    print(i)
    exit()

print(0)
# Judge status: Accepted
from collections import Counter
n = int(input())
s = [int(i) for i in input().split()]

s_set = set(s)

counted = Counter(s)
ans = sum(i*(i-1)/2 for i in counted.values())

for i in s:
    x = counted[i]
    print(int(ans - x + 1))
# Judge status: Accepted
import math
A,B = map(int,input().split())
ans = -1
for i in range(1,100100):
    if math.floor(i*0.08) ==A and  math.floor(i*0.1) ==B :
        ans = i
        break
print(ans)
# Judge status: Accepted
A,B,C,K = map(int ,input().split())

if A >= K:
    print(K)
elif B >= K-A:
    print(A)
else:
    print(A-(K-(A+B)))
# Judge status: Accepted
red, green, blue = map(int, input().split())
k = int(input())

cnt = 0
while red >= green:
    green *= 2
    cnt += 1
while green >= blue:
    blue *= 2
    cnt += 1

if cnt <= k:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
stand = []
emp = [100]
ans = []

line = input().split()
x = int(line[0])
if int(line[1]) == 0:
  ans = x
  
elif int(line[1]) != 0:
  line2 = input().split()
  for i in range(-100,201):
    stand.append(int(i))
    
  for i in line2:
    if int(i) in stand:
      stand.remove(int(i))
  for i in stand:
    candi = abs(x - i)
    if candi < emp[0]:
      emp[0] = candi
      ans = i

print(ans)
# Judge status: Accepted
import numpy as np

n = int(input())
l = [0 for i in range(0, 201)]

for i in range(1, 201):
    for j in range(i, 201):
        if j/i == int(j/ i):
            l[j] += 1

l = np.array(l[1:n+1:2])>=8
print(sum(l))
# Judge status: Wrong Answer
#coding utf-8

N = int(input())
s = list(input())
t = list(input())
Flg = True
for i in range(N,-1,-1):
    if s[N-i:N] == t[:i+1]:
        ans = 2 * N - i
        Flg = False
        break

if Flg:
    ans = 2 * N
    if s[-1] == t[0]:
        ans = 2 * N - 1
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())

def solve(N,M):
  # 今あるもの
  if M < N * 2:
    return M // 2
  
  M -= N * 2
  
  ans = N + (M // 4)
  return ans

print(solve(N,M))
# Judge status: Accepted
import math
A,B,C = map(int,input().split())

ans = 0
while(1):
  tmp_A,tmp_B,tmp_C = A,B,C
  if((tmp_A%2 == 1)or(tmp_B%2 == 1)or(tmp_C%2 == 1)):
    break   
  A,B,C = (tmp_B+tmp_C)//2, (tmp_C+tmp_A)//2, (tmp_A+tmp_B)//2
  if((tmp_A == A)and(tmp_B == B)and(tmp_C == C)):
    ans = -1
    break
  ans += 1

print(ans)
# Judge status: Wrong Answer
import sys

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

hg = 10 ** 18
ans = 1
for i in a:
    ans *= i
    if ans > hg:
        print(-1)
        sys.exit()

print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())

flag = 0
x = [-1] * N
for m in range(M):
  s, c = map(int, input().split())
  if (x[s-1] != -1) & (x[s-1] != c):
    #print("{} {}".format(s,c))
    flag = 1
    break
  else:
    x[s-1] = c
#print(x)
    
ans = 0
for n in range(N):
  if x[n] != -1:
    ans += 10**(N-n-1) * x[n]
#print(ans)

if (N == 1) & (M > 0):
  print(ans)

elif (ans >= 10**(N-1)) & (flag == 0):
  print(ans)
else:
  print(-1)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int, input().split()))

dp = [0] * n
dp[1] = abs(h[1]-h[0])
for i in range(2, n):
    dp[i] = min(dp[i-1] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1]))
print(dp[-1])
# Judge status: Accepted
s = list(input())
l = len(s)

for bit in range((l-1)**2):
    ans_sum = int(s[0])
    ans_str = s[0]
    for i in range(l-1):
        if (bit >> i) & 1:
            ans_sum += int(s[i+1])
            ans_str += '+'
        else:
            ans_sum -= int(s[i+1])
            ans_str += '-'
        ans_str += s[i+1]
    if ans_sum == 7:
        print(ans_str+'=7')
        exit(0)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 0 - -(n - 1)//(k - 1)

print(ans)
# Judge status: Accepted
A, B, T = map(int, input().split())
print((T//A)*B)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1,n):
    if a[i-1] > a[i]:
        ans += a[i-1] - a[i]
        a[i] = a[i-1]
print(ans)
# Judge status: Accepted
def factorial(n):
    if n == 0 or n == 1 or n < 0:
        return 1
    return n * factorial(n-1)

N,M = map(int,input().split())

even = int(factorial(N) / (2 * (factorial(N-2))))
odd = int(factorial(M) / (2 * (factorial(M-2))))
print(even+odd)
# Judge status: Accepted
import numpy as np
n=int(input())
a=list(map(int,input().split()))
a=np.array(a)
a=a//400
a1=[i for i in a if i<8]
a2=[i for i in a if i>=8]
k=len(set(a1))
m=k+len(a2)
#>8:m=8 else:m=k+len(a2)
if len(set(a1))!=0:s=len(set(a1))
else:s=1
print(s,m)
# Judge status: Accepted
import itertools
n, m, q = map(int,input().split())
A = itertools.combinations_with_replacement(range(1,m+1),n)
cond = [list(map(int,input().split())) for i in range(q)]
ma = 0
for a in A:
    p = 0
    for c in cond:
        if a[c[1]-1]-a[c[0]-1] == c[2]:
            p += c[3]
    if ma < p:
        ma = p

print(ma)
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 != 0:
    print("No")
else:
    half1 = s[0:int(n/2)]
    half2 = s[int(n/2):]
    if half1 == half2:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import sys
from fractions import gcd
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))

L = [0] * (N+1)
R = [0] * (N+1)

def calc_gcd(x, y):
  if x == 0:
    return y
  elif y == 0:
    return x
  else:
    return gcd(x, y)

for i in range(N):
  L[i+1] = calc_gcd(L[i], A[i])
  R[N-1-i] = calc_gcd(R[N-i], A[N-1-i])

print(max(list(gcd(L[i], R[i+1]) for i in range(N))))
# Judge status: Accepted
A,B,C = map(int,input().split())
ans = 0

if not (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
  print(0)
  exit()

if A == B and B == C:
  print(-1)
  exit()
  
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
  A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
  ans += 1
  
  if A == B and B == C:
    print(-1)
    exit()
    
print(ans)
# Judge status: Accepted
N, A, B = map(int,input().split())
if A > B:
    print(0)
elif A == B:
    print(1)
else:
    if N == 1:
        print(0)
    else:
        minimum = A*(N-1)+B
        maximum = B*(N-1)+A
        print(maximum-minimum+1)
# Judge status: Wrong Answer
from math import sqrt

eps = 1e-8

def eq(a, b):
    return a + eps > b and a - eps < b

a, b, c = list(map(int, input().split()))
sq = 2 * sqrt(a * b)
if eq(sq, c - a - b):
    print("No")
elif 2 * sqrt(a * b) < c - a - b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=int(10**15+1)
for _ in range(5):
  b=int(input())
  a=min(a,b)
print(5+(n//a))
# Judge status: Accepted
X = int(input())
ans = 0 

ans += (X // 500) * 1000
ans += ((X % 500) // 5 ) * 5

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

for i in range(10 ** 5):
    if (i * b + c) % a == 0:
        print('YES')
        exit()

print('NO')
# Judge status: Wrong Answer
import numpy as np

n,m=map(int,input().split())
a=list(map(int,input().split()))
aa=np.array(a)

while True:
    aa=aa//2
    if (aa%2).any()==1:
      break
     
if (aa%2).all()!=1:
  print(0);exit()

t=list(set(aa))


import fractions as fr
from functools import reduce

def gcd(*numbers):
    return reduce(fr.gcd, numbers)

def gcd_list(numbers):
    return reduce(fr.gcd, numbers)


lcm=np.prod(t)//gcd_list(t)

print(int((m/lcm+1)//2))
# Judge status: Accepted
if __name__ == "__main__":
    S = list(input())
    T = list(input())
    count = 0
    for i, s in enumerate(S):
        if T[i] != s:
            count += 1
    print(count)
# Judge status: Wrong Answer
import fractions


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    mul = a[0]
    for i in range(1, n):
        mul = mul * a[i] // fractions.gcd(mul, a[i])
    if m > mul // 2:
        ans = (m - mul // 2) // mul + 1
        print(int(ans))
    else:
        print(0)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(1,n-1):
    x = p[i-1:i+2]
    x.sort()
    if x[1] == p[i]:
        ans+=1
print(ans)
# Judge status: Accepted
i = list(map(int, input().split()))
count = 0
if i[0] <= i[1]:
    print("1")
else:
    while i[0] > 0:
        i[0] -= i[1]
        count += 1
    print(count)
# Judge status: Accepted
S=input()
print("yes" if len(S)==len(set(S)) else "no")
# Judge status: Wrong Answer
n,m = map(int,input().split())
if n >= 3 and m >= 3:
    ans = (n-2) * (m-2)
elif n >= 3 and m==1:
    ans = n-2
elif m >= 3 and n==1:
    ans = m-2
else:
    ans = 0
print(ans)
# Judge status: Accepted
from collections import deque
n = int(input())
a = list(input().split())

ball = []
for i in range(n, 0, -1):
    c = 2
    while i * c <= n:
        if a[i*c-1] == "1":
            a[i-1] = "1" if a[i-1] == "0" else "0"
        c += 1
    if a[i-1] == "1":
        ball.append(str(i))

print(len(ball))
if ball != []: print(" ".join(ball))
# Judge status: Wrong Answer
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:n//2] == s[n//2:]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N ,M = map(int, input().split())

s = [0] * M
c = [0] * M

for i in range(M):
    s[i], c[i] = map(int, input().split())

for i in range(1000):
    x = str(i)
    count = 0
    if len(x) != N:
        continue
    for j in range(M):
        if x[s[j]-1] == str(c[j]):
            count += 1
    if count == M:
        print(x)
        break
else: 
    print(-1)
# Judge status: Accepted
a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
	if int(c)%2==1:
		x=x+ans[i]
	elif int(c)%2==0:
		x=x+ans2[i]
	c=c+1
if x>=1:
	print("No")
else:
	print("Yes")
# Judge status: Accepted
A, B, C = map(int, input().split())
aa = []
now = A
T = True
while T:
  if now % B == C:
    print("YES")
    T = False
    quit()
  else:
    if (now % B) not in aa:
      aa.append(now % B)
      now += A
      #print(aa)
    else:
      print("NO")
      quit()
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
n=int(input())

a,b,c= sorted([a,b,c])
print(a+b+c*n)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(N: int):
    print(-(-N // 111) * 111)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()
# Judge status: Accepted
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

x,y= map(int, input().split())
if (x in A and y in A) or (x in B and y in B):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b = list(map(int,input().strip().split()))

if a == 1 and b ==1:
  print("draw")
elif a == 1:
  print("Alice")
elif b == 1:
  print("Bob")
elif a > b:
  print("Alice")
elif b > a:
  print("Bob")
else:
  print("draw")
# Judge status: Accepted
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
if a-b==d-e==g-h and b-c==e-f==h-i and a-c==d-f==g-i and a-d==b-e==c-f and d-g==e-h==f-i and a-g==b-h==c-i:print("Yes")
else:print("No")
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b = input().split()
    x = int(a + b)

    def judge():
        for i in range(10001):
            if i ** 2 == x:
                return True
        return False

    if judge():
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
D = int(input())
C = list(map(int, input().split()))
#  S = [[1st day], [2nd day],  ..., [D-th day]]
S = []
for i in range(D):
    Si = list(map(int, input().split()))
    S.append(Si)
I = 26

last = [0]*I

score = S[1]
contest = score.index(max(score))

last = [x+1 for x in last]
last[contest] = 0

print(contest + 1)

for day in range(1, D):
    score = [(last[i]*C[i])**3*S[day][i] for i in range(I)]
    contest = score.index(max(score))

    last = [x+1 for x in last]
    last[contest] = 0

    print(contest + 1)
# Judge status: Wrong Answer
N=str(input())
ABC=[chr(i) for i in range(65, 65+26)]
if N in ABC:
    print("A")
else:
    print("B")
# Judge status: Wrong Answer
N = int(input())
a = [int(i) for i in input().split()]


s = sum(a)
m = pow(10, 9)
b = a[0]
for i in range(1, N-1):
    b += a[i]
    c = s - b
    #print(b)
    #print(c)
    if m > (abs(b-c)):
        m = abs(b-c)
    print(a[i])
print(m)
# Judge status: Accepted
n = int(input())
s = input().split()
s = [int(i) for i in s]
mul = 1
flag = 0

if 0 in s:
    print(0)
else:


    for item in s:
        mul *= item
        if flag == 1:
            break

        if mul >  1e18:
            print(-1)
            flag = 1

    if mul <=  1e18:
        print(mul)
# Judge status: Accepted
N = int(input())
A = [int(input()) for i in range(N)]
ans = 0
for i in range(N-1):
    ans += (A[i] + A[i+1])//2
    A[i+1] = min(A[i+1], (A[i] + A[i+1]) % 2)
if N == 1:
    print(A[0]//2)
    exit()
print(ans)
# Judge status: Wrong Answer
n,a,b,c,d=map(int,input().split())
print('YNeos'[('...' in input() or c<d)::2])
# Judge status: Accepted
A, B, C = map(int, input().split())

if C >= A and C <= B:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
S = list(input())
A = S.count("R") * S.count("G") * S.count("B")

for i in range(N-3):
  for j in range(i+1, N-1):
    k = j-i+j
    if k<N and S[k] != S[j] and S[k] != S[i] and S[i] !=S[j]:
      A -= 1

print(A)
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
keep = [0]*(n)

for i in range(1, n):
    keep[i] = keep[i-1]
    l, r = i-1, i+1
    if s[l:r] == "AC":
        keep[i] += 1

for j in range(q):
    l, r = map(int, input().split())
    print(keep[r-1]-keep[l-1])
# Judge status: Wrong Answer
import math

N = int(input()) * 3
a = list(map(int, input().split()))
ans = 0

a = sorted(a, reverse = True)

for i in range(1, math.ceil(N/2 + 1), 2):
    #print(ans)
    ans += a[i]

print(ans)
# Judge status: Accepted
a,b = [int(a) for a in input().split()]
if a>9 or b>9:
  print(-1)
elif 1<=a<=9 and 1<=b<=9:
  print(a*b)
# Judge status: Wrong Answer
#097
# 1 <= a,b,c <= 100
# 1 <= d <= 100
a, b, c, d =map(int, input().split())

AB = abs(a - b)
BC = abs(b - c)
AC = abs(a - c)

if AC <=d:
    print("Yes")
elif AB <= d and BC <= d:
    print("Yes")
else:
    print("NO")
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    A, B, C, D = [s for s in input().rstrip()]

    ops = ["+", "-"]
    for op1 in ops:
        for op2 in ops:
            for op3 in ops:
                eq = "".join([A, op1, B, op2, C, op3, D])
                res = eval(eq)
                if res == 7:
                    ans = eq + "=7"

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#--------------------------------------------
#ライブラリ呼び出し
import sys
import math
#--------------------------------------------
D, N = map(int, input().split())

if N ==100:
    N=101

ans=(100**D)*N
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(N % K - (N // K))
# Judge status: Wrong Answer
import numpy as np
 
N = input()
X = list(map(int, input().split()))
ans=9999999
for P in range(max(X)):
  sum = np.sum(list(map(lambda x: (x-P)**2, X)))
  ans = min(ans, sum)
    
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())

A = [i for i in map(int, input().split())]

days = N-sum(A)
print(days if days >= 0 else -1)
# Judge status: Accepted
from collections import Counter
S = Counter(list(input()))
T = Counter(list(input()))
if len(S) != len(T):
    print("No")
else:
    Sv = []
    Tv = []
    for v in S.values():
        Sv.append(v)
    for v in T.values():
        Tv.append(v)
    Svc = Counter(Sv)
    Tvc = Counter(Tv)
    if Svc == Tvc:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = input()

happy = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        happy += 1

m = 0
for i in range(1, N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        m += 1

if K <= m:
    happy += 2*K
else:
    happy += 2*(m-1)
    if S[0] != S[N-1]:
        happy += 1
print(happy)
# Judge status: Accepted
a,b,c= map(int, input().split())
if (a <= c and b >= c):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, M = map(int, input().split())
list_A = list(map(int, input().split()))

list_A = sorted(list_A, reverse=True)

total_vote = sum(list_A)

if M > len(list_A):
    answer = 'No'
elif (list_A[M -1] / total_vote) < 1/(4*M):
    answer = 'No'
else:
    answer = 'Yes'

print(answer)
# Judge status: Wrong Answer
A,B = map(int, input().split())
ans = 1
while B-A > 0:
    B = B-(A-1)
    ans+=1
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a==b:print(2*a)
else:print(2*max(a,b)-1)
# Judge status: Accepted
N, R = map(int, input().split())

if N>=10:
    print(R)
else:
    s = 100*(10-N)
    #print(s)
    print(R + s)
# Judge status: Wrong Answer
N, K, Q = [int(n) for n in input().split()]
l = [0] * N
for i in range(Q):
    l[int(input())-1] += 1

ans = ['yes' if K + v - Q > 0 else 'No' for v in l]

for a in ans:
    print(a)
# Judge status: Accepted
N,K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

flag = [0] * N
score = 0
for i in range(N):
    if i >= K and flag[i-K] == 0 and T[i] == T[i-K]:
        flag[i] = 1
        continue
    if T[i] == 'r':
        score += P
    if T[i] == 's':
        score += R
    if T[i] == 'p':
        score += S
print(score)
# Judge status: Wrong Answer
import collections
N = int(input())

a = collections.Counter(list(map(int,input().split())))
#a = sorted(a.items(), key=lambda x: -x[0],reverse=True)
#for k, v in sorted(a.items(), key=lambda x: -x[0]):pass
a = sorted(a.items(), key=lambda x:x[0],reverse=True)

#print(a)

cnt = 0
num = []
n = 0
for i,v in a:
    if 4 <= v:
        n = max(n,(i*i))
    elif 2 <= v:
        num.append(i)
        cnt += 1
    if 2 == cnt:
        break
if cnt == 2:
    print(max(num[0]*num[1],n))
else:
    print(n)
# Judge status: Wrong Answer
k,a,b=map(int,input().split())

if a+1<b:
    #できるだけbをしたほうが得
    print((k//(a+1))*b+k%(a+1))

else:
    print(1+k)
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N = int(readline())
A = [int(readline()) for i in range(N)]

ans = 0
for i in range(N):
  pair, mod = divmod(A[i],2)
  ans += pair
  if mod:
    if i + 1 < N and A[i + 1] > 0:
      ans += 1
      A[i + 1] -= 1
  
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
while True:
    c = c-b
    if c<=0:
        print("Yes")
        break
    a = a-d
    if a<=0:
        print("No")
        break
# Judge status: Accepted
n = int(input())
d = [input().split(" ") for _ in range(n)]

f = False
for i in range(n-2):
    if d[i][0] == d[i][1] and not f :
        if d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]:
            f = True
if f:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def lcm(a, b):
  return a // gcd(a, b) * b

def gcd(a, b):
  if(b == 0): return a
  else: return gcd(b, a % b)

def cnt(a):
  res = 0
  while(a and a % 2 == 0):
    a //= 2
    res += 1
  return res

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

l = 1
c = cnt(A[0])
for a in A:
  if cnt(a) != c or c == 0:
    print(0)
    exit()
  else:
    l = lcm(l, a // 2)
d = m // l
print((d + 1) // 2)
# Judge status: Accepted
import fractions 
N=int(input())
A=list(map(int,input().split()))
t=A[0]
for i in range(1,N):
  t=(t*A[i])//fractions.gcd(t,A[i])
ans=0
for i in range(N):
  ans+=t//A[i]
print(ans%(10**9+7))
# Judge status: Wrong Answer
K,X=map(int,input().split())
list=[i for i in range(X-K+1,X+K)]
strs = [str(num) for num in list]
print('　'.join(strs))
# Judge status: Accepted
a,b=map(int,input().split()) 
print("Yay!" if a<=8 and b<=8 else ":(" )
# Judge status: Wrong Answer
N = 6
K = 3
S = 'ABBCAB'
print('ABbCAB')
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
a = list(map(int,input().split()))
a_count = sorted(Counter(a).items(),reverse=True)
f = False
for k,v in a_count:
    if v >= 4:
        print (v*2)
        exit ()
    elif 2 <= v and v <= 3:
        if f:
            print (x*k)
            exit (0)
        else:
            x = k
            f = True
    else:
        pass
print (0)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
res = 0
for x in range(N-1):
  res += B[x]
  if A[x] + 1 == A[x+1]:
    res += C[A[x] - 1]
print(res)
# Judge status: Wrong Answer
a = input()
t =list(a)
if t[len(t)-1] == "?":
    t[len(t)-1] = "D"
for i in reversed(range(1,len(t)-1)):
    if t[i] == "?" and t[i+1] == "D":
        t[i] = "P"
    elif t[i] == "?":
        t[i] = "D"
if t[0] == "?":
    if t[1] == "D" or t[1] == "?":
        t[0] = "P"
    else:
        t[0] = "D"
answer = "".join(t)
print(answer)
# Judge status: Wrong Answer
x, y = map(int, input().split())

ans = -1
if x==y:
    print(-1)
else:
    x *= 2
    while x <= 10**18:
        if x % y == 0:
            x *= x
        else:
            ans = x
            break
    print(x)
# Judge status: Wrong Answer
w,h,x,y=map(int,input().split())
ans=w*h/2
a=0
if( ((x==0 or x==w) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==0 or y==h)) ):
  a=0
else:
  if(((x==w/2) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==h/2))):
    a=0
  else:
   	a=1
if(x==w/2 and y==h/2):a=1
print(ans,a)
# Judge status: Accepted
l = [1,2,3]
a = int(input())
b = int(input())
c = [o for o in l if o not in [a,b]]
print(c[0])
# Judge status: Wrong Answer
N=int(input())
A=[int(_) for _ in input().split(" ")]

ans=0

max=max(A)

for i in range(len(A)):
  if A[i] == max:
    a=i
    break

if a==0:
  total=0
  for i in range(len(A)):
    total=total+max-A[i]
  print(total)
  exit()
  
   
tmp=0
for i in range(a):
  if tmp < A[i]:
    tmp=A[i]

#print("tmp",tmp,"a",a,"A[a]",A[a])
  
total=0
for i in range(a):
  total += tmp - A[i]
  #print("total",total)
  
for i in range(a,len(A)):
  total += max - A[i]
  #print("total",total)

print(total)