CodeEff/ECCO huggingface dataset:
# Original solution
n,m,k = list(map(int, input().split()))

from collections import deque

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

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

an = [0] + an
bn = bn

vMax = 10**9+10

import itertools

accum_a = [0]
accum_b = [0]



candidate = []


for b_i in range(0,len(bn)):
    i_ = accum_b[-1] + bn[b_i]
    if i_ > k:
        break
    accum_b.append(i_)

accum_b.reverse()

countMax = 0
for a_i in range(0,len(an)):


    sumCandidate = accum_a[-1] + an[a_i]
    if sumCandidate > k:
        break
    accum_a.append(sumCandidate)

    rest = k - sumCandidate

    bIndex = 0
    for j, accB in enumerate(accum_b):
        if accB <= rest:
            bIndex = len(accum_b) - 1 - j
            break


    countMax = max(countMax, a_i + bIndex)



print(countMax)

# Optimized solution
n,m,k = list(map(int, input().split()))

from collections import deque

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

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

accum_a = [0]
accum_b = [0]


for a_i in range(0,len(an)):

    sumCandidate = accum_a[-1] + an[a_i]
    if sumCandidate > k:
        break
    accum_a.append(sumCandidate)

for b_i in range(0,len(bn)):
    i_ = accum_b[-1] + bn[b_i]
    if i_ > k:
        break
    accum_b.append(i_)

j = len(accum_b) - 1
ans = 0
for i in range(len(accum_a)):

    if accum_a[i] > k:
        break

    while accum_b[j] > k - accum_a[i]:
        j -= 1

    ans = max(ans, i+j)
print(ans)
# Original solution
import sys
from itertools import accumulate
from bisect import bisect_right

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, M, K, *AB = list(map(int, read().split()))
    A = AB[:N]
    B = AB[N:]

    time_A = [0]
    time_A.extend(accumulate(A))

    time_B = [0]
    time_B.extend(accumulate(B))

    ans = 0
    for i in range(N + 1):
        tmp = i
        ta = time_A[i]
        if ta <= K:
            tb = K - ta
            j = bisect_right(time_B, tb)
            tmp += j - 1

            if ans < tmp:
                ans = tmp

    print(ans)
    return


if __name__ == '__main__':
    main()


# Optimized solution
import sys
from itertools import accumulate
from bisect import bisect_right

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, M, K, *AB = list(map(int, read().split()))
    A = AB[:N]
    B = AB[N:]

    time_A = [0]
    time_A.extend(accumulate(A))

    time_B = [0]
    time_B.extend(accumulate(B))

    ans = 0
    j = M
    for i, ta in enumerate(time_A):
        while j > 0 and ta + time_B[j] > K:
            j -= 1

        if ta + time_B[j] > K:
            break

        if ans < i + j:
            ans = i + j

    print(ans)
    return


if __name__ == '__main__':
    main()
# Original solution
import sys
readline = sys.stdin.readline
from bisect import bisect_right

def main():
    N, M, K = list(map(int, readline().rstrip().split()))
    A = list(map(int, readline().rstrip().split()))
    B = list(map(int, readline().rstrip().split()))

    a_acc, b_acc = A[:], B[:]
    for i in range(1, N):
        a_acc[i] += a_acc[i-1]
    
    for i in range(1, M):
        b_acc[i] += b_acc[i-1]
    
    res = 0
    for i, a in enumerate(a_acc):
        if a > K:
            break
        left = K - a
        j = bisect_right(b_acc, left)
        res = max(res, i + 1 + j)
    
    res = max(res, bisect_right(a_acc, K))
    res = max(res, bisect_right(b_acc, K))

    print(res)

if __name__ == '__main__':
    main()

# Optimized solution
import sys
readline = sys.stdin.readline
from bisect import bisect_right

def main():
    N, M, K = list(map(int, readline().rstrip().split()))
    A = list(map(int, readline().rstrip().split()))
    B = list(map(int, readline().rstrip().split()))

    a_acc, b_acc = A[:], B[:]
    for i in range(1, N):
        a_acc[i] += a_acc[i-1]
    
    for i in range(1, M):
        b_acc[i] += b_acc[i-1]
    
    res = 0
    for i, a in enumerate(a_acc):
        if a > K:
            break
        left = K - a
        j = bisect_right(b_acc, left)
        res = max(res, i + 1 + j)
    
    #res = max(res, bisect_right(a_acc, K))
    res = max(res, bisect_right(b_acc, K))

    print(res)

if __name__ == '__main__':
    main()
# Original solution
from itertools import accumulate, permutations

import bisect


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

A = [0] + list(accumulate(A))
B = [0] + list(accumulate(B))

ans = 0
for i in range(N+1):
    a = A[i]
    if a > K:
        continue
    r = K - a
    j = bisect.bisect(B, r) - 1
    ans = max(ans, i + j)

print(ans)


# Optimized solution
from itertools import accumulate, permutations

import bisect
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

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

A = [0] + list(accumulate(A))
B = [0] + list(accumulate(B))

ans = 0
for i in range(N+1):
    a = A[i]
    if a > K:
        break
    r = K - a
    j = bisect.bisect(B, r) - 1
    ans = max(ans, i + j)

print(ans)
# Original solution
N,M,K = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = [0]
b = [0]
ans = 0
max_num = 0
j = 0
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(N+1):
    if a[i] > K:
        break
    else:
        j = M
        while b[j] > K - a[i]:
            j -=1
            if j <0:
                break
    ans = max(ans,i + j)
print(ans)

# Optimized solution
N,M,K = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = [0]
b = [0]
ans = 0
max_num = 0
j = M
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(N+1):
    if a[i] > K:
        break
    else:
        while b[j] > K - a[i]:
            j -=1
            if j <0:
                break
    if K>= a[i] + b[j]:
        ans = max(ans,i + j)
print(ans)
# Original solution
from collections import deque
from bisect import bisect

N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
R_A = deque()
R_A.append(0)
i = 0
while i < N:
  R_A.append(R_A[-1]+A[i])
  i += 1 
B = list(map(int, input().split()))
R_B = deque()
R_B.append(0)
i = 0
while i < M:
  R_B.append(R_B[-1]+B[i])
  i += 1 
R_B = list(R_B)
ans = 0
i = 0
while i <= N:
  m = K - R_A[i]
  if m < 0:
    break
  idx = bisect(R_B, m)
  ans = max(ans, i+idx-1)
  R_B = R_B[:idx+1]
  i += 1
print(ans)



# Optimized solution
from bisect import bisect

N, M, K = list(map(int, input().split()))
A = [0]+list(map(int, input().split()))
B = list(map(int, input().split()))
R_B = [0]*(M+1)
i = 0
while i < M:
  R_B[i+1] = R_B[i]+B[i]
  i += 1 
ans = 0
i = 0
while i <= N and K >= A[i]:
  K -= A[i]
  idx = bisect(R_B, K)
  ans = max(ans, i+idx-1)
  i += 1
print(ans)
# Original solution
def main():
    n, m, k = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    sum_A = [A[0]]
    sum_B = [B[0]]

    for i in range(n - 1):
        sum_A.append(sum_A[i] + A[i + 1])

    for i in range(m - 1):
        sum_B.append(sum_B[i] + B[i + 1])

    R = []

    b = m - 1
    flag = False
    while b > -1:
        if sum_B[b] <= k:
            R.append(b + 1)
            flag = True
            break
        else:
            b -= 1

    if not flag:
        R.append(0)

    for i in range(n):
        a = sum_A[i]

        b = m - 1
        flag = False
        while b > -1:
            if sum_B[b] <= k - a:
                R.append(i + 1 + b + 1)
                flag = True
                break
            else:
                b -= 1

        if not flag:
            if 0 <= k - a:
                R.append(i + 1)
            else:
                R.append(0)

    print((max(R)))
    # while k > 0 and (a < n or b < m):
    #     if a == n:
    #         time = B[b]
    #     elif b == m:
    #         time = A[a]
    #     else:
    #         time = min(A[a], B[b])

    #     if k - time < 0:
    #         break

    #     r += 1
    #     k -= time
    #     print(k)

    #     if a == n:
    #         b += 1
    #     elif b == m:
    #         a += 1
    #     else:
    #         if A[a] >= B[b]:
    #             b += 1
    #         else:
    #             a += 1

    # print(r)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n, m, k = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    sum_A = [A[0]]
    sum_B = [B[0]]

    for i in range(n - 1):
        sum_A.append(sum_A[i] + A[i + 1])

    for i in range(m - 1):
        sum_B.append(sum_B[i] + B[i + 1])

    R = []

    b = m - 1
    flag = False
    while b > -1:
        if sum_B[b] <= k:
            R.append(b + 1)
            flag = True
            break
        else:
            b -= 1

    if not flag:
        R.append(0)

    for i in range(n):
        a = sum_A[i]

        flag = False
        while b > -1:
            if sum_B[b] <= k - a:
                R.append(i + 1 + b + 1)
                flag = True
                break
            else:
                b -= 1

        if not flag:
            if 0 <= k - a:
                R.append(i + 1)
            else:
                R.append(0)

    print((max(R)))
    # while k > 0 and (a < n or b < m):
    #     if a == n:
    #         time = B[b]
    #     elif b == m:
    #         time = A[a]
    #     else:
    #         time = min(A[a], B[b])

    #     if k - time < 0:
    #         break

    #     r += 1
    #     k -= time
    #     print(k)

    #     if a == n:
    #         b += 1
    #     elif b == m:
    #         a += 1
    #     else:
    #         if A[a] >= B[b]:
    #             b += 1
    #         else:
    #             a += 1

    # print(r)


if __name__ == '__main__':
    main()
# Original solution
from sys import stdin
import bisect

def main():
    input = stdin.readline
    n, m, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = [0] * (n + 1)
    for i in range(n):
        c[i + 1] = c[i] + a[i]
    d = [0] * (m + 1)
    for i in range(m):
        d[i + 1] = d[i] + b[i]
    cnt = 0
    for i in range(n + 1):
        if c[i] > k:
            break
        e = bisect.bisect_right(d, k - c[i])
        if e > m and cnt < i + m:
            cnt = i + m
        if e <= m and cnt < i + e - 1:
            cnt = i + e - 1
    print(cnt)
main()

# Optimized solution
from sys import stdin
import bisect

def main():
    input = stdin.readline
    n, m, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = [0] * (n + 1)
    for i in range(n):
        c[i + 1] = c[i] + a[i]
    d = [0] * (m + 1)
    for i in range(m):
        d[i + 1] = d[i] + b[i]
    cnt = 0
    for i in range(n + 1):
        if c[i] > k:
            break
        e = bisect.bisect_right(d, k - c[i])
        if cnt < i + e - 1:
            cnt = i + e - 1
    print(cnt)
main()
# Original solution
import bisect
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
A_cumulative_sum = [0]
B_cumulative_sum = [B[0]]
for i in range(N):
    A_cumulative_sum.append(A[i] + A_cumulative_sum[i])
for i in range(1, M):
    B_cumulative_sum.append(B[i] + B_cumulative_sum[i - 1])

for i in range(N + 1):
    if K < A_cumulative_sum[i]:
        remaining_time = K
        idx = bisect.bisect_right(B_cumulative_sum, remaining_time)
        ans = max(ans, idx)
        break
    else:
        remaining_time = K - A_cumulative_sum[i]
        idx = bisect.bisect_right(B_cumulative_sum, remaining_time)
        ans = max(ans, i + idx)
print(ans)

# 113897

# Optimized solution

N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
'''
with open('./b09.txt') as f:
    N, M, K = map(int, f.readline().split())
    A = list(map(int, f.readline().split()))
    B = list(map(int, f.readline().split()))
'''
A_cnt = 0
B_cnt = 0
ans = 0
nowK = K
for A_idx in range(N):
    if nowK < A[A_idx]:
        break
    ans += 1
    nowK -= A[A_idx]
    A_cnt += 1
for B_idx in range(M):
    if nowK < B[B_idx]:
        break
    ans += 1
    nowK -= B[B_idx]
    B_cnt += 1
tmp_ans = ans
finish = False
for i in range(A_cnt, 0, -1):
    nowK += A[i - 1]
    tmp_ans -= 1
    for j in range(B_cnt, M):
        if finish or nowK < B[j]:
            break
        nowK -= B[j]
        tmp_ans += 1
        B_cnt += 1
    ans = max(tmp_ans, ans)
print(ans)
# Original solution
N, M, K = list(map(int, input().split()))
INF = int(1e18)
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = A[:]
B = B[:]
i, j = 0, 0
mcnt = 0
tmp = M+1
ccnt = 0
while tmp != 0:
  ccnt += 1
  tmp //= 2
LA = [0 for _ in range(N+1)]
LB = [0 for _ in range(M+1)]
for i in range(N):
  LA[i+1] = LA[i] + A[i]
for i in range(M):
  LB[i+1] = LB[i] + B[i]
for i in range(N+1):
  l, r = 0, M+1
  d = (l + r) // 2
  if LA[i] <= K:
    if LB[M] + LA[i] <= K:
      mcnt = max(i + M, mcnt)
    else:
      for j in range(ccnt + 1):
        if LB[d] + LA[i] <= K:
          l = d
          d = (l + r) // 2
        else:
          r = d
          d = (l + r) // 2
      mcnt = max(i + d, mcnt)
  else:
    break
print(mcnt)

# Optimized solution
N, M, K = list(map(int, input().split()))
INF = int(1e18)
A = list(map(int, input().split()))
B = list(map(int, input().split()))
i, j = 0, 0
mcnt = 0
tmp = M+1
ccnt = 0
while tmp != 0:
  ccnt += 1
  tmp //= 2
LA = [0 for _ in range(N+1)]
LB = [0 for _ in range(M+1)]
for i in range(N):
  LA[i+1] = LA[i] + A[i]
for i in range(M):
  LB[i+1] = LB[i] + B[i]
for i in range(N+1):
  l, r = 0, M+1
  d = (l + r) // 2
  if LA[i] <= K:
    if LB[M] + LA[i] <= K:
      mcnt = max(i + M, mcnt)
    else:
      for j in range(ccnt + 1):
        if LB[d] + LA[i] <= K:
          l = d
          d = (l + r) // 2
        else:
          r = d
          d = (l + r) // 2
      mcnt = max(i + d, mcnt)
  else:
    break
print(mcnt)
# Original solution
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
memo = [[None] * (M + 1) for _ in range(N + 1)]
for i in range(1, len(A)):
    A[i] += A[i - 1]
for i in range(1, len(B)):
    B[i] += B[i - 1]
A.insert(0, 0)
B.insert(0, 0)
r = 0
for i, a in enumerate(A):
    for j, b in enumerate(B):
        k = K - a - b
        if k < 0:
            break
        r = max(r, i + j)
print(r)

# Optimized solution
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, len(A)):
    A[i] += A[i - 1]
for i in range(1, len(B)):
    B[i] += B[i - 1]
A.insert(0, 0)
B.insert(0, 0)
r = 0
for i, a in enumerate(A):
    min_idx = 0
    max_idx = len(B) - 1
    while min_idx < max_idx:
        j = (min_idx + max_idx + 1) // 2
        k = K - A[i] - B[j]
        if k < 0:
            max_idx = j - 1
        else:
            min_idx = j
    j = min_idx
    while j + 1 < len(B) and K - A[i] - B[j + 1] >= 0:
        j += 1
    if K - A[i] - B[j] >= 0:
        r = max(r, i + j)
print(r)
# Original solution
n, m, k = list(map(int, input().split()))

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

a = [0]
b = [0]

for i in range(n):
    a.append(a[i] + A[i])

for i in range(m):
    b.append(b[i] + B[i])

for i in range(n + 1):
    if a[i] > k:
        break
    for j in range(m + 1):
        if a[i] + b[j] <= k:
            ans = max(ans, i + j)
        else:
            break
print(ans)

# Optimized solution
n, m, k = list(map(int, input().split()))

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

a = [0]
b = [0]

for i in range(n):
    a.append(a[i] + A[i])

for i in range(m):
    b.append(b[i] + B[i])

j = m

for i in range(n + 1):
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    else:
        ans = max(ans, i + j)
print(ans)
# Original solution
n, m, k = list(map(int, input().split()))

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

a = [0]
b = [0]

for i in range(n):
    a.append(a[i] + A[i])

for i in range(m):
    b.append(b[i] + B[i])

j = m

for i in range(n + 1):
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    else:
        ans = max(ans, i + j)
print(ans)

# Optimized solution
n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
ans = 0

for i in range(n):
    A.append(A[i] + a[i])

for i in range(m):
    B.append(B[i] + b[i])

j = m

for i in range(n + 1):
    if A[i] > k:
        break
    while A[i] + B[j] > k:
        j -= 1
    ans = max(ans, i + j)

print(ans)
# Original solution
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

calc_A = [0]
calc_B = [0]

for i in range(N):
    calc_A.append(calc_A[i] + A[i])

for j in range(M):
    calc_B.append(calc_B[j] + B[j])

ans = 0

for i in range(N+1):
    j = M
    if calc_A[i] > K:
        break
    while calc_B[j] > K - calc_A[i]:
        if j > 0:
            j -= 1
        else:
            break
    if ans < i + j:
        ans = i + j

print(ans)

# Optimized solution
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

check_A = [0]
check_B = [0]

for a in range(N):
    check_A.append(check_A[a] + A[a])

for b in range(M):
    check_B.append(check_B[b] + B[b])

ans = 0
j = M

for i in range(N+1):
    if check_A[i] > K:
        break
    while check_B[j] > K - check_A[i]:
        j -= 1
    ans = max(ans, i+j)

print(ans)
# Original solution
n, m, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a = [0]
b = [0]
for i in range(n):
  a.append(a[i]+A[i])
for j in range(m):
  b.append(b[j]+B[j])
#print(a,b)

ans = 0
for i in range(n+1):
  j = 0
  if a[i] > k:
    break
  while (k - a[i]) >= b[j]:
    j += 1
    if j == m:
      break
  
  if k < (a[i] + b[j]):
      j -= 1
  ans = max(ans, i+j)
     
print(ans)


# Optimized solution
n, m, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a = [0]
b = [0]
for i in range(n):
  a.append(a[i]+A[i])
for j in range(m):
  b.append(b[j]+B[j])
#print(a,b)
 
ans = 0
j = m
for i in range(n+1):
  if a[i] > k:
    break
  while (k - a[i]) < b[j]:
    j -= 1
    if j == -1:
      break
  
  ans = max(ans, i+j)
     
print(ans)
# Original solution
X=int(eval(input()))
if X==7 or X==5 or X==3:
    print('YES')
else:
    print('NO')

# Optimized solution
N=int(eval(input()))
if N==3 or N==5 or N==7:
  print('YES')
else:
  print('NO')
# Original solution
x = int(eval(input()))
if x==3 or x==5 or x==7:
    print("YES")
else:
    print("NO")



# Optimized solution
X = int(eval(input()))
if(X == 3 or X == 5 or X == 7):
    print("YES")
else:
    print("NO")
# Original solution
x = int(eval(input()))
if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")

# Optimized solution
x = int(eval(input()))
if x in [3,5,7]:
    print("YES")
else:
    print("NO")
# Original solution
x = int(eval(input()))
if x in [3, 5, 7]:
    print('YES')
else:
    print('NO')

# Optimized solution
print((['NO','YES'][int(eval(input()))in[3,5,7]]))
# Original solution
x = int(eval(input()))

if x == 5 or x == 3 or x == 7:
    print("YES")
else:
    print("NO")


# Optimized solution
x = int(eval(input()))

if x == 3 or x == 5 or x == 7:
    ans = 'YES'
else:
    ans = 'NO'
print(ans)
# Original solution
X = int(eval(input()))
if X == 7 or X == 5 or X == 3:
    print('YES')
else:
    print('NO')

# Optimized solution
X = int(eval(input()))

if X in (3, 5, 7):
    print('YES')
    
else:
    print('NO')
# Original solution
X = int(eval(input()))

if X == 3 or X == 5 or X == 7:
    print("YES")
else:
    print("NO")

# Optimized solution
X = int(eval(input()))
if X == 7 or X == 5 or X == 3:
    print("YES")
else:
    print("NO")
# Original solution
N = int(eval(input()))
if N==3 or N==5 or N==7:
  print("YES")
else:
  print("NO")

# Optimized solution
N = int(eval(input()))
print(("YES" if N==3 or N==5 or N==7 else "NO"))
# Original solution
X = int(eval(input()))
if X == 3 or X == 5 or X == 7:
    print("YES")
else :
    print("NO")

# Optimized solution
print(("YES" if [7, 5, 3].count(int(eval(input()))) else "NO"))
# Original solution
print(('YES' if int(eval(input())) in [3, 5, 7] else 'NO'))

# Optimized solution
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X = ir()
bl = (3 <= X <= 7) and X&1
print(('YES' if bl else 'NO'))
# Original solution
N = int(eval(input()))

if N == 3 or N == 5 or N == 7:
	print("YES")
else:
	print("NO")


# Optimized solution
N = int(eval(input()))

print((["NO", "YES"][N == 3 or N == 7 or N == 5]))
# Original solution
a=int(eval(input()))
print(("YES"if a==3 or a==5 or a==7 else"NO"))
        

# Optimized solution
s=[3,5,7]
print(("YES"if s.count(int(eval(input())))>0 else"NO"))
# Original solution
import itertools
import math
import fractions
import functools
import copy

n = int(eval(input()))
if n ==7 or n ==5 or n == 3:
    print("YES")
else: print("NO")

# Optimized solution
def main():
    n = int(eval(input()))
    # t, a = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()
    if n == 7 or n == 5 or n==3 :
        print("YES")
    else: print("NO")



if __name__ == '__main__':
    main()
# Original solution
a=input();print("NO") if a!="5" and a!="3" and a!="7" else print("YES")


# Optimized solution
print("YES") if input()in["3","5","7"] else print("NO")
# Original solution
x=int(eval(input()))
print(("YES" if x==7 or x==5 or x==3 else "NO"))


# Optimized solution
x = int(eval(input()))
print(("YES" if x in [7, 5, 3] else "NO"))
# Original solution
X = int(eval(input()))
print(('YES' if X in (3,5,7) else 'NO'))

# Optimized solution
X = int(eval(input()))
print(('YES' if X in (7,5,3) else 'NO'))
# Original solution
a = int(eval(input()))
print(("YES" if a == 3 or a == 5 or a == 7 else "NO"))

# Optimized solution
a = int(eval(input()))
print(("YES" if a == 3 or a == 5 or a == 7 else "NO")) # if a in (3, 5, 7) else
# Original solution
X = int(eval(input()))
if X in [3, 5, 7]:
    print("YES")
else:
    print("NO")


# Optimized solution
n=int(eval(input()))
print((["NO","YES"][n in {3,5,7}]))
# Original solution
x = int(eval(input()))
if x in (7,5,3):
    print('YES')
else:
    print('NO')


# Optimized solution
n = int(eval(input()))
if n in (7, 5, 3):
    print('YES')
else:
    print('NO')
# Original solution
X = int(eval(input()))
if(X in [7, 5, 3]):
  print("YES")
else:
  print("NO")

# Optimized solution
x = int(eval(input()))
ans = "NO"
if x in [7, 5, 3]:
  ans = "YES"
print(ans)
# Original solution
X = int(eval(input()))
if X == 7 or X == 5 or X == 3:
    print('YES')
else:
    print('NO')

# Optimized solution
x = int(eval(input()))
if x in [7, 5, 3]:
    print('YES')
else:
    print('NO')
# Original solution
n, m, c = list(map(int, input().split()))
l = (0,) + tuple(map(int, input().split()))
a = [0] * (c + 1)
w = [tuple(map(int, input().split())) for _ in range(n)]
w.sort(key = lambda x:x[1], reverse = True)
v = 0
for i in range(n):
    if a[w[i][0]] < l[w[i][0]]:
        v += w[i][1]
        a[w[i][0]] += 1
    if sum(a) == m:
        break
print(v)


# Optimized solution
n, m, c = list(map(int, input().split()))
l = [0] + list(map(int, input().split()))
w = [tuple(map(int, input().split())) for _ in range(n)]
w.sort(key = lambda x:x[1], reverse = True)
v = 0
p = 0
for i in range(n):
    if l[w[i][0]]:
        l[w[i][0]] -= 1
        v += w[i][1]
        p += 1
        if p == m:
            break
print(v)