Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
N,M=map(int,input().split())
come=[]
for i in range(M):
  ab=list(map(int,input().split()))
  if ab[0]==1:
    if ab[1] in come:
      print("POSSIBLE")
      sys.exit()
    come+=[ab[1]]
  if ab[1]==N:
    if ab[0] in come:
      print("POSSIBLE")
      sys.exit()
    come+=[ab[0]]
 
print("IMPOSSIBLE")

### FIXED CODE ###

import sys
N,M=map(int,input().split())
come=[0]*N
for i in range(M):
  ab=list(map(int,input().split()))
  if ab[0]==1:
    if come[ab[1]]:
      print("POSSIBLE")
      sys.exit()
    come[ab[1]]=1
  if ab[1]==N:
    if come[ab[0]]:
      print("POSSIBLE")
      sys.exit()
    come[ab[0]]=1
 
print("IMPOSSIBLE")
### BUGGY CODE ###

S = input()
Q = int(input())

for i in range(Q):
    queryi = input()
    if queryi == '1':
        S = S[::-1]
    
    else:
        T, F, C = queryi.split()
        if F == '1':
            S = C + S
        else:
            S = S + C

print(S)

### FIXED CODE ###

import sys
S = input()
Q = int(input())
key = 1

for i in sys.stdin:
    if i[0] == '0':
        break

    if i[0] == '1':
        key = -key
    
    elif key == 1:
        if i[2] == '1':
            S = i[4] + S
        else:
            S = S + i[4]

    else:
        if i[2] == '2':
            S = i[4] + S
        else:
            S = S + i[4]


print(S[::key])
### BUGGY CODE ###

# 19:04
n = int(input())
s = input()


def check(s, i, j, k):
    ii = 0
    jj = 0
    for l in range(len(s)):
        if ii == 1:
            if jj == 1:
                if s[l] == str(k):
                    return 1
            elif s[l] == str(j):
                jj = 1
        elif s[l] == str(i):
            ii = 1
    return 0


sum = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            sum += check(s, i, j, k)


print(sum)


### FIXED CODE ###

# 19:04
n = int(input())
s = input()


def check(s, i, j, k):
    ii = 0
    jj = 0
    for l in range(len(s)):
        if ii == 1:
            if jj == 1:
                if s[l] == str(k):
                    return 1
            elif s[l] == str(j):
                jj = 1
        elif s[l] == str(i):
            ii = 1
    return 0


sum = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            sum += check(s, i, j, k)


print(sum)
### BUGGY CODE ###

#!/usr/bin/env python3
# Christmas Eve

N = list(map(int, (input().strip().split(' '))))
K = N[1]
N = N[0]
i = 0
h = []
while i < N:
  hi = int(input().strip())
  h.append(hi)
  i += 1
h = sorted(h)

i = 0
min_i = i
min_diff = 10000000000
while i < N - K + 1:
  sub = h[i:i+K]
  diff = sub[K-1] - sub[0]
  if min_diff > diff:
    min_diff = diff
    min_i = i
  i += 1
print(min_diff)

"""
med = sum(h)/len(h)
print(list(map(lambda x:x-med, h)))
"""

### FIXED CODE ###

#!/usr/bin/env python3
# Christmas Eve

N = list(map(int, (input().strip().split(' '))))
K = N[1]
N = N[0]
i = 0
h = []
while i < N:
  hi = int(input().strip())
  h.append(hi)
  i += 1
h = sorted(h)

i = 0
min_diff = 10000000000
while i < N - K + 1:
  diff = h[i+K-1] - h[i]
  if min_diff > diff:
    min_diff = diff
  i += 1
print(min_diff)
### BUGGY CODE ###

n,m=map(int,input().split())
l=sorted([list(map(int,input().split())) for _ in range(m)])
ans=0
for i in range(m):
    if l[i][0]!=1:break
    else:
        for j in range(i+1,m):
            if set(l[i])^set(l[j])=={1,n}:
                ans=1
                break
print("POSSIBLE" if ans==1 else "IMPOSSIBLE")

### FIXED CODE ###

n,m=map(int,input().split())
sa=set()
sb=set()
for i in range(m):
    a,b=map(int,input().split())
    if a==1:sa.add(b)
    if b==n:sb.add(a)
print("IMPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE")
### BUGGY CODE ###

from collections import deque

def search(now):   #今いる頂点からけんけんぱでいける点を列挙する
    ret = []
    for v in edge[now]:
        for v2 in edge[v]:
            ret += edge[v2]
    return list(set(ret))

N, M = map(int, input().split())
edge = [[] for _ in range(N)]
for i in range(M):
    u, v = map(int,input().split())
    edge[u-1].append(v-1)
S,T = map(int,input().split())
S -=1
T -=1

distance = [10**9 for _ in range(N)]
distance[S] = 0

queue = deque([S])
while queue:
    u = queue.popleft()
    for next in search(u):
        if distance[u]+1 < distance[next]:
            distance[next] = distance[u]+1
            queue.append(next)
if distance[T] < 10**9:
    print(distance[T])
else:
    print(-1)

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
edge = [[] for _ in range(3*N)]
for i in range(M):
    u, v = map(int,input().split())
    for i in range(3):
        edge[i*N + u-1].append(((i+1)%3)*N + (v-1))
S,T = map(int,input().split())
S -=1
T -=1

distance = [10**9 for _ in range(3*N)]
distance[S] = 0

queue = deque([S])
while queue:
    u = queue.popleft()
    for next in edge[u]:
        if distance[u]+1 < distance[next]:
            distance[next] = distance[u]+1
            queue.append(next)
if distance[T] < 10**9:
    print(distance[T]//3)
else:
    print(-1)
### BUGGY CODE ###

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

if N == 1:
    print(P)
    exit()

primelist=[]
powerlist=[]

p=2
while 1:
    Q = p**N
    if P < Q:
        break
    elif P == Q:
        primelist.append(p)
        powerlist.append(1)
        break
#    elif p**(N+1) > P:
#        p = P**(1/N)
#        if p == int(p):
#            primelist.append(int(p))
#            powerlist.append(1)
#        break

#    f = 0
#    for q in primelist:
#        if p % q == 0:
#            f = 1
#            break
#    if f == 1:
#        p += 1
#        continue
#    else:
    k = 0
    while P % p == 0:
        P //= p
        k += 1
    primelist.append(p)
    powerlist.append(k//N)
    p += 1

ans = 1
for i in range(len(primelist)):
    ans *= (primelist[i]**powerlist[i])

print(ans)

### FIXED CODE ###

import math

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

if N == 1:
    print(P)
    exit()

ans = 1
p = 2
logP = math.log(P)
while N * math.log(p) <= logP:
    k = 0
    while P % p == 0:
        P //= p
        k += 1
    ans *= p**(k//N)
    if k > 0:
        logP = math.log(P)

    r = p % 6
    if r == 1:
        p += 4
    elif r == 5:
        p += 2
    else:
        p += 1

print(ans)
### BUGGY CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W = map(int, input().split())
grid = [[v for v in input()[:-1]] for _ in range(H)]

Q = []
cnt = 0
for i in range(H):
    for j in range(W):
        if grid[i][j] == "#":
            Q.append([i, j])
            cnt += 1

DX = [-1, 1, 0, 0]
DY = [0, 0, -1, 1]
d = 0
# for _ in range(5):
while cnt < H*W:
    d += 1
    tmp = []
    #print("d->", d)
    # print(Q)
    # print(dist)
    # print(cnt)
    # print("-------")
    while Q:
        x, y = Q.pop(0)
        for dx, dy in zip(DX, DY):
            nx = x+dx
            ny = y+dy
            if 0 <= nx < H and 0 <= ny < W:
                if grid[nx][ny] == ".":
                    grid[nx][ny] = "#"
                    tmp.append([nx, ny])
                    cnt += 1
            else:
                continue
    Q = tmp
# print(dist)
print(d)


### FIXED CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W = map(int, input().split())
grid = [[v for v in input()[:-1]] for _ in range(H)]

Q = []
cnt = 0
for i in range(H):
    for j in range(W):
        if grid[i][j] == "#":
            Q.append([i, j])
            cnt += 1

DX = [-1, 1, 0, 0]
DY = [0, 0, -1, 1]
d = 0
# for _ in range(5):
while cnt < H*W:
    d += 1
    tmp = []
    #print("d->", d)
    # print(Q)
    # print(dist)
    # print(cnt)
    # print("-------")
    for x, y in Q:
        for dx, dy in zip(DX, DY):
            nx = x+dx
            ny = y+dy
            if 0 <= nx < H and 0 <= ny < W:
                if grid[nx][ny] == ".":
                    grid[nx][ny] = "#"
                    tmp.append([nx, ny])
                    cnt += 1
            else:
                continue
    Q = tmp
# print(dist)
print(d)
### BUGGY CODE ###

# salsa=0, rumba=1
# [0 1 0 1] 1より上の位に帯する操作

# 繰り上がりを考慮しつつ、3（より上）の位に対する操作を考える
# [1]       1の位が0である数字の、3の位に対する操作
# [0 1 0]   1の位が1である数字の、3の位に対する操作
# []        1の位が2である数字の、3の位に対する操作
# ある数字が"2"の時にルンバが来れば繰り上がる（上の位にルンバが波及）
# それ以外の状態では、上の位にとってルンバは無いのと同じことになる
# サルサは常に影響するが、連続した2つのサルサは打ち消し合い、無いのと同じことになる

# 再帰的に上の位を決める
# []        3,1の位が00,10である数字の、9の位に対する操作
# [1]       3,1の位が20である数字の、9の位に対する操作
# []        3,1の位が01,21である数字の、9の位に対する操作
# [0 1 0]   3,1の位が11である数字の、9の位に対する操作
# []        3,1の位が02,12,22である数字の、9の位に対する操作

# 一度繰り上がったら、例えば100.. と0がd個続くとして、
# 更にその上の位に波及させるには 2^d オーダーの操作が必要となるので、各操作列は徐々に減っていく

n = int(input())
t = input()
op = [[int(c == 'R') for c in t]]
ans = [0]

for d in range(n):
    k = 3 ** d
    nop = []
    nans = [0] * (k * 3)
    for g in range(3):  # d桁目の数
        for i in range(k):  # d桁目未満の数
            opg = op[i]
            opn = []
            h = g
            for o in opg:
                if o == 0:
                    if len(opn) > 0 and opn[-1] == 0:
                        opn.pop()
                    else:
                        opn.append(0)
                    if h == 1:
                        h = 2
                    elif h == 2:
                        h = 1
                else:
                    if h == 2:
                        h = 0
                        opn.append(1)
                    else:
                        h += 1
            nop.append(opn)
            nans[g * k + i] = h * k + ans[i]

    op = nop
    ans = nans

print(*ans)


### FIXED CODE ###

# salsa=0, rumba=1
# [0 1 0 1] 1より上の位に帯する操作

# 繰り上がりを考慮しつつ、3（より上）の位に対する操作を考える
# [1]       1の位が0である数字の、3の位に対する操作
# [0 1 0]   1の位が1である数字の、3の位に対する操作
# []        1の位が2である数字の、3の位に対する操作
# ある数字が"2"の時にルンバが来れば繰り上がる（上の位にルンバが波及）
# それ以外の状態では、上の位にとってルンバは無いのと同じことになる
# サルサは常に影響するが、連続した2つのサルサは打ち消し合い、無いのと同じことになる

# 再帰的に上の位を決める
# []        3,1の位が00,10である数字の、9の位に対する操作
# [1]       3,1の位が20である数字の、9の位に対する操作
# []        3,1の位が01,21である数字の、9の位に対する操作
# [0 1 0]   3,1の位が11である数字の、9の位に対する操作
# []        3,1の位が02,12,22である数字の、9の位に対する操作

# 一度繰り上がったら、例えば100.. と0がd個続くとして、
# 更にその上の位に波及させるには 2^d オーダーの操作が必要となるので、各操作列は徐々に減っていく

n = int(input())
t = input()
op = [[int(c == 'R') for c in t]]
ans = [0]

for d in range(n):
    k = 3 ** d
    nop = []
    nans = [0] * (k * 3)
    for g in range(3):  # d桁目の数
        for i in range(k):  # d桁目未満の数
            opg = op[i]
            opn = []
            h = g
            for o in opg:
                if o == 0:
                    if len(opn) > 0 and opn[-1] == 0:
                        opn.pop()
                    else:
                        opn.append(0)
                    if h == 1:
                        h = 2
                    elif h == 2:
                        h = 1
                else:
                    if h == 2:
                        h = 0
                        opn.append(1)
                    else:
                        h += 1
            nop.append(opn)
            nans[g * k + i] = h * k + ans[i]

    op = nop
    ans = nans

print(*ans)
### BUGGY CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()
    A = LI()

    A.sort()
    divisible = [False] * N

    for i in range(N):
        for j in range(N):
            if not divisible[j] and i != j:
                if A[j] % A[i] == 0:
                    # print(A[j], A[i])
                    divisible[j] = True

    print(divisible.count(False))

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

import sys, collections
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()
    A = LI()

    cnt = collections.Counter(A)
    A = list(set(A))
    A.sort()
    A_max = A[-1]
    divisible = [False] * (A_max + 1)

    for i in A:
        for j in range(2 * i, A_max+1, i):
            divisible[j] = True

    ans = 0
    for i in A:
        tmp = 0
        if not divisible[i] and cnt[i] == 1:
            tmp += 1
        ans += tmp

        
    print(ans)

if __name__ == '__main__':
    resolve()
### BUGGY CODE ###

N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if min(P[0:i+1]) == P[i]:
        cnt += 1
print(cnt)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
cnt = 0
min_n = P[0]
for i in range(N):
    if min_n >= P[i]:
        cnt += 1
        min_n = P[i]
print(cnt)
### BUGGY CODE ###

import collections as cl
import math


def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

cnt = cl.Counter(A)
ans = 0
mem = {}

for a in A:
    if a in mem:
        print(mem[a])
        continue
    ans = 0
    cnt[a] -= 1
    for v in cnt.values():
        if v < 2:
            continue
        ans += combinations_count(v, 2)
    cnt[a] += 1
    print(ans)
    mem[a] = ans


### FIXED CODE ###

import collections as cl
import math


def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

cnt = cl.Counter(A)
ans = 0
for v in cnt.values():
    ans += combinations_count(v, 2)

for a in A:
    print(ans - cnt[a]+1)
### BUGGY CODE ###

from collections import Counter
n=int(input())
p=sorted(list(map(int,input().split())))
s=set()
m = 10**6+1
a=[True for _ in range(m)]

for x in p:
    if a[x]:
        s.add(x)
    i = 2
    y = i*x
    while y<m:
        a[y] = False
        i+=1
        y = i*x
 
c = Counter(p)
for (k,v) in c.items():
    if v>1:
        s.discard(k)
print(len(s))


### FIXED CODE ###

n=int(input())
p=sorted(list(map(int,input().split())))
s=set()
m = 10**6+1
a=[True for _ in range(m)]
prev = 0
for x in p:
    if prev == x:
        s.discard(x)
        continue
    if a[x]:
        s.add(x)
    i = 2
    y = i*x
    while y<m:
        a[y] = False
        i+=1
        y = i*x
    prev=x

print(len(s))
### BUGGY CODE ###

n,q=map(int,raw_input().split())
ans={}
t=-1
for i in range(q):
    a,v=map(int,raw_input().split())
    if ans.has_key(a):
        ans[a]+=v
    else:
        ans[a]=v
    if t==-1:
        t=a
    elif ans[a]>ans[t] or (ans[a]==ans[t] and a<t):
        t=a

    if v<0:
        t=-1
    if t==-1:
        for i in ans:
            if t==-1:
                t=i
            elif ans[t]<ans[i]:
                t=i
            elif ans[t]==ans[i] and t>i:
                t=i
    print t,ans[t]
exit()

### FIXED CODE ###

n,q=map(int,raw_input().split())
ans=[0]*n
key=value=0
for i in range(q):
    a,v=map(int,raw_input().split())
    a-=1
    ans[a]+=v
    if a==key and v<0:
        value=max(ans)
        key=ans.index(value)
    elif ans[a]>value:
        key=a
        value=ans[a]
    elif ans[a]==value and a<key:
        key=a
    print key+1,value
### BUGGY CODE ###

import sys
from collections import deque
import copy


def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [s] = [(input_raw[0])]
    input_raw = read_func().strip().split()
    [K] = [int(input_raw[0])]

    sub_s_list = [""]
    for i in range(K):
        min_str = "z" * 5000
        for j in range(len(s)):
            sub = ""
            for k in range(j, len(s)):
                if sub in sub_s_list:
                    sub += s[k]
                if sub not in sub_s_list and sub < min_str:
                    min_str = sub
        sub_s_list.append(min_str)
    print sub_s_list[K]
                


if __name__ == '__main__':
    main()

### FIXED CODE ###


import sys
from collections import deque
import copy
import math

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [S] = [(input_raw[0])]
    input_raw = read_func().strip().split()
    [K] = [int(input_raw[0])]
##    if len(S) >= K:
##        min_s = "zzzzzzz"
##        for i in range(len(S) - K):
##            if S[i : i + K]< min_s:
##                min_s = S[i : i + K]
##        print min_s
##        return
##    else:
    sub_list = set([])
    for i in range(len(S)):
        for j in range(i + 1, i + 6):
            sub_list.add(S[i:j])

    sub_list = list(sub_list)
    sub_list.sort()
    print sub_list[K - 1]


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n = int(input())
s = input()

count = 0

for i,first in enumerate(s[:-2]):
    for j,second in enumerate(s[i+1:n-1]):
        if first != second:
            for k,third in enumerate(s[i+j+2:]):
                if j != k:
                    if third != first and third != second:
                        count += 1

print(count)

### FIXED CODE ###

n = int(input())
s = input()

r_count = s.count('R')
g_count = s.count('G')
b_count = s.count('B')

count = r_count*g_count*b_count


for i,elem in enumerate(s):
    length = min(i,n-1-i)
    for j in range(1,length+1):
        elem_2 = s[i-j]
        elem_3 = s[i+j]
        if elem != elem_2 and elem != elem_3 and elem_2 != elem_3:
            count -= 1

print(count)
### BUGGY CODE ###

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


cnt=0
for i in range(n):
    flg=0
    for j in range(n):
        if i==j:
            continue

        if a[i]%a[j]==0:
            flg+=1

    if flg==0:
        cnt+=1

print(cnt)

### FIXED CODE ###

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

a=sorted(a)
m=max(a)
dp=[0]*(m+1)
d={}
cnt=0
for i in range(n):
    b=a[i]
    if b in d:
        d[b]+=1
        continue
    else:
        d[b]=1
    j=b
    while b<=m+b:
        if b>m:
            break
        dp[b]+=1
        b+=j
        


for i in a:
    if dp[i]==1 and d[i]==1:
        cnt+=1

print(cnt)
### BUGGY CODE ###






N,Q = map(int,input().split())
S = []
for c in str(input()):
    S.append(c)

for i in range(Q):
    l, r = map(int, input().split())
    count = 0
    for i in range(len(S[int(l-1):int(r)])-1):
        if (S[int(l-1):int(r)][i] == "A"):
            if (S[int(l-1):int(r)][i+1] == "C"):
                count += 1
    print(count)
            
        
    
    
    





### FIXED CODE ###





import numpy as np

N,Q = map(int,input().split())
S = []
for c in str(input()):
    S.append(c)

a = np.zeros(N)
   
for i in range(1,N):
    if (S[i-1] == "A")and(S[i] == "C"):
        a[i] = a[i-1] + 1
    else:
        a[i] = a[i-1]
        
for i in range(Q):
    l, r = map(int, input().split())
    print(int(a[r-1] - a[l-1]))
### BUGGY CODE ###

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

for i in range(M):
  B, C = map(int, input().split())
  A.extend([C for _ in range(B)])

A.sort(reverse = True)
l = A[0:lenA]

print(sum(l))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]
lenA = len(A)
minA = min(A)
BC.sort(reverse = True, key = lambda x:x[1])

i = 0
cnt = 0
while cnt < lenA and i < M:
  A.extend([BC[i][1] for _ in range(BC[i][0])])
  cnt += BC[i][0]
  i += 1
A.sort(reverse = True)
l = A[0:lenA]

print(sum(l))
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys

N,S, *A = map(int, sys.stdin.buffer.read().split())
mod = 998244353

answer = [0 for _ in range(S+1)]
power2 = 1

for j in range(N):
  a = A[j]
  answer_next = [(2*answer[i])%mod for i in range(S+1)]
  if a<=S:
    answer_next[a] = (answer_next[a]+power2)%mod
    for i in range(a+1,S+1):
      answer_next[i] = (answer_next[i]+answer[i-a])%mod
  answer = answer_next
  power2 = (2*power2)%mod

print(answer[S])

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys

N,S, *A = map(int, sys.stdin.buffer.read().split())
mod = 998244353

answer = [0 for _ in range(S+1)]
power2 = 1

for a in A:
  answer_next = [(2*b)%mod for b in answer]
  if a<=S:
    answer_next[a] = (answer_next[a]+power2)%mod
    for i in range(a+1,S+1):
      answer_next[i] = (answer_next[i]+answer[i-a])%mod
  answer = answer_next
  power2 = (2*power2)%mod

print(answer[S])
### BUGGY CODE ###

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

latest_score = 0
before_score = 0

for cnt_k in range(k):
    if latest_score == 0:
        latest_score = a[cnt_k]
    else:
        latest_score *= a[cnt_k]

for cnt in range(1, n - k + 1):
    before_score = latest_score
    latest_score = 0
    for cnt_score in range(cnt, cnt + k):
        if latest_score == 0:
            latest_score = a[cnt_score]
        else:
            latest_score *= a[cnt_score]

    if before_score < latest_score:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

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

for cnt in range(1, n - k + 1):
    if a[cnt-1] < a[cnt + k - 1]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N=input().split()
p=[int(e) for e in input().split()]
NN=int(N[0])
MM=int(N[1])
p2=[0.]*(NN-MM+1)
for i in range(NN-MM+1):
    for j in range(MM):
        p2[i]=p2[i]+(p[i+j]+1)/2

print(max(p2))

### FIXED CODE ###

N,K=map(int,input().split())
p=list(map(int,input().split()))
for i in range(N-1):
    p[i+1]=p[i+1]+p[i]
max=p[K-1]
if N>K:
    for i in range(1,N-K+1):
        tmp=p[i+K-1]-p[i-1]
        if max < tmp:
            max=tmp
print((max+K)/2.)
### BUGGY CODE ###

import sys
from collections import deque
input = sys.stdin.readline

N, K = [int(x) for x in input().strip().split()]
highest = 0
lowest = 10 ** 9
q = deque([])
ans = 10 ** 9
pre = -1
H = sorted([int(input()) for _ in range(N)])
for n, ne in enumerate(H):
    q.append(ne)
    if len(q) > K:
        pre = q.popleft()
    if ne > highest:
        highest = ne
    if ne < lowest:
        lowest = ne
    if pre == highest:
        highest = max(q)
    if pre == lowest:
        lowest = min(q)
    if n >= K - 1:
        ans = min(ans, highest - lowest)

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = [int(x) for x in input().strip().split()]
H = sorted([int(input()) for _ in range(N)])
ans = 10 ** 9
for n in range(N - (K - 1)):
    ans = min(ans, H[n+K-1] - H[n])

print(ans)
### BUGGY CODE ###

S = list(input())
n = len(S)
res = 0
cur = 0
count = [0] * 2020
for i, c in enumerate(map(int, S)):
    cur = cur * 10 + c
    if cur % 2019 == 0:
        res += 1
    temp = (cur * 10 ** (n - i)) % 2019
    res += count[temp]
    count[temp] += 1
print(res)


### FIXED CODE ###

S = list(input())
n = len(S)
cur = 0
count = [0] * 2020
count[0] = 1
for i, c in enumerate(map(int, S[::-1])):
    cur = (cur + c * pow(10, i, 2019)) % 2019
    count[cur] += 1
    
print(sum(c * (c - 1) // 2 for c in count))