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

S=input()
modn=10**9+7
qnum=S.count('?')
lenS=len(S)

dp=[[0]*13 for _ in range(lenS+1)]
dp[0][0]=1

for i in range(lenS):
    for j in range(13):
        if S[i]=='?': 
            for k in range(10):
                dp[i+1][(j*10+k)%13]+=dp[i][j]
                dp[i+1][(j*10+k)%13]%=modn
        else:
            dp[i+1][(j*10+int(S[i]))%13]+=dp[i][j]
            dp[i+1][(j*10+int(S[i]))%13]%=modn

print(dp[lenS][5])


### FIXED CODE ###

M=10**9+7
r=[[(j-k)*9%13 for j in range(10)]for k in range(13)]
d=[1]+[0]*12
for c in input():
    d = [sum(d[j]for j in k)%M for k in r] if c>'9' else [d[(int(c)-k)*9%13]for k in range(13)]
print(d[5])
### BUGGY CODE ###

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]
    
    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.group=[np.array([0]*n) for i in range(l)]
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num
    
block=make_block(k,n)

def get_block_num(i):
    return block[i]    

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print(" ".join(ans))
    

### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]

    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num

block=make_block(k,n)

def get_block_num(i):
    return block[i]

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print(" ".join(ans))
### BUGGY CODE ###

#!python3

def LI():
    return list(map(int, input().split()))

# input
N = int(input())
UVW = [LI() for _ in range(N - 1)]

# params
link = [[] for _ in range(N)]
w = [[None] * N for _ in range(N)]
for u, v, c in UVW:
    u -= 1
    v -= 1
    link[u].append(v)
    link[v].append(u)
    w[u][v] = w[v][u] = c


def main():
    ans = [None] * N
    ans[0] = 0
    l = [0]
    while l:
        next_l = []
        for i in l:
            for j in link[i]:
                if ans[j] is None:
                    ans[j] = (ans[i] + w[i][j] % 2) % 2
                    next_l.append(j)
        l = next_l

    for a in ans:
        print(a)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!python3

import sys
sys.setrecursionlimit(10 ** 6)


def LI():
    return list(map(int, input().split()))

# input
N = int(input())
UVW = [LI() for _ in range(N - 1)]


# params
link = [[] for _ in range(N)]
for u, v, w in UVW:
    u -= 1
    v -= 1
    link[u].append((v, w))
    link[v].append((u, w))


def dfs(ans, x):
    for y, w in link[x]:
        if ans[y] is None:
            if w % 2 == 0:
                ans[y] = ans[x]
            else:
                ans[y] = 0 if ans[x] else 1
            dfs(ans, y)


def main():
    ans = [None] * N
    ans[0] = 0
    dfs(ans, 0)
    for a in ans:
        print(a)


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

N, Q = map(int,input().split()) # 複数の数字を変数に格納
List_ab = [list(map(int,input().split())) for i in range(N-1)] # [[1,2],[3,4],[5,6]]
List_px = [list(map(int,input().split())) for i in range(Q)] # [[1,2],[3,4],[5,6]]

count_list = [0]*N

List_ab.sort()
List_px.sort()

for i in range(Q):
    p = List_px[i][0]
    x = List_px[i][1]
    for j in range(N):
        if p == j+1:
            count_list[j] += x
        
for i in range(N-1):
    a = List_ab[i][0]
    b = List_ab[i][1]
    count_list[b-1] += count_list[a-1]
    
print(*count_list)

### FIXED CODE ###

N, Q = map(int,input().split()) # 複数の数字を変数に格納
List_ab = [list(map(int,input().split())) for i in range(N-1)] # [[1,2],[3,4],[5,6]]
List_px = [list(map(int,input().split())) for i in range(Q)] # [[1,2],[3,4],[5,6]]

count_list = [0]*N

List_ab.sort()

for i in range(Q):
    count_list[List_px[i][0]-1] += List_px[i][1]
        
for i in range(N-1):
    count_list[List_ab[i][1]-1] += count_list[List_ab[i][0]-1]
    
print(*count_list)
### BUGGY CODE ###



if __name__ == '__main__':
    N,A,B=list(map(int,input().split()))
    V=list(map(int,input().split()))

    import itertools
    max_mean=0
    numbers=[]
    V.sort(reverse=True)

    for i in range(A,B+1):
        temp=V[:i]
        temp_mean=sum(temp)/i
        if max_mean<temp_mean:
            max_mean=temp_mean

    for i in range(A, B + 1):
        temp = V[:i]
        temp_mean = sum(temp) / i
        if max_mean == temp_mean:
            numbers.append(i)

    count=0

    for number in numbers:
        for conbination in itertools.combinations(V,number):
            if sum(conbination)/number==max_mean:
                count+=1

    print(max_mean)
    print(count)


### FIXED CODE ###


def combination_table(N):
    C=[[0 for i in range(N)] for j in range(N)]
    for i in range(N):
        for j in range(i):
            if j==0 or j==i:
                C[i][j]=1
            else:
                C[i][j]=C[i-1][j-1]+C[i-1][j]
    return C[2:]

if __name__ == '__main__':
    N,A,B=list(map(int,input().split()))
    V=list(map(int,input().split()))
    V.sort(reverse=True)
    temp=V[:A]
    max_mean=sum(temp)/A
    count=0
    C=combination_table(N+2)

    if V[0]!=V[A-1]:
        temp_1=V.count(V[A-1])
        temp_2=V[:A].count(V[A-1])
        count+=C[temp_1-1][temp_2]
        """temp_1=V.count(V[0])
        temp_2=V[:A].count(V[0])
        count+=C[temp_1-1][temp_2]"""
    elif V[0]==V[A-1]:
        for i in range(A,B+1):
            temp_1=V.count(V[0])
            count+=C[temp_1-1][i]

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

S = input()
ans = 0
num = 0

while 'W' in S:
    ans += S.find('W') - num
    num += 1
    S = S[:S.find('W')] + 'E' + S[S.find('W') + 1:]

print(ans)

### FIXED CODE ###

S = input()
ans = - int((1 + S.count('W')) * S.count('W')/2)
num = 0

for i in range(len(S)):
    if S[i] == 'W':
        ans += i + 1
print(ans)
### BUGGY CODE ###

s=input()
n=len(s)
d=dict(zip(list(range(2019)),[0]*2019))
for i in range(n):
  d[int(s[i:])%2019]+=1
ans=0
for _,i in d.items():
  ans+=i*(i-1)//2
ans+=d[0]
print(ans)

### FIXED CODE ###

s=input()
n=len(s)
d=[0]*2019
d[0]=1
j=1
ans=0
now=0
for i in s[::-1]:
  now=(now+int(i)*j)%2019
  ans+=d[now]
  d[now]+=1
  j*=10
  j%=2019
print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 1
for i in range (N):
    ans *= A[i]

if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 1
A = sorted(A)
for i in range (N):
    ans *= A[i]
    if ans > 10**18:
        ans = -1
        break

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

h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
I=h*w
d=[I]*I
a=~w+a*w+b
d[a]=1
q=[a]
for s in q:
 for y,x in(1,0),(-1,0),(0,1),(0,-1):
  for z in range(k):
   i,j=s//w+y*~z,s%w+x*~z;t=i*w+j
   if(h>i>-1<j<w)-1or'.'<m[i][j]or d[t]<d[s]:break
   if d[t]==I:q+=t,;d[t]=d[s]+1
print(d[~w+f*w+g]%I-1)

### FIXED CODE ###

I=9**9
h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
d=[I]*h*w
a=~w+a*w+b
d[a]=1
q=[a]
for s in q:
 for y,x in(1,0),(-1,0),(0,1),(0,-1):
  for z in range(k):
   i,j=s//w+y*~z,s%w+x*~z;t=i*w+j
   if(h>i>-1<j<w)-1or'.'<m[i][j]or d[t]<=d[s]:break
   if d[t]==I:q+=t,;d[t]=d[s]+1
print(d[~w+f*w+g]%I-1)
### BUGGY CODE ###

N = int(input())
Ls = list(map(int, input().split()))
count = 0
for i in range(N-2):
    a = Ls[i]
    for k in range(i+1,N-1):
        b = Ls[k]
        count = count + len(list(filter(lambda c: a+b>c and b+c>a and c+a>b, Ls[k+1:N])))
print(count)

### FIXED CODE ###

import bisect
n = int(input())
lis = sorted(list(map(int,input().split())))
count = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        index = bisect.bisect_left(lis,lis[i]+lis[j])
        count += index-1-j
print(count)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans *= A[i]
if ans > 10 ** 18:
    ans = -1
print(ans)


### FIXED CODE ###

N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
if A[-1] == 0:
    print(0)
    exit()
ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10 ** 18:
        ans = -1
        break
print(ans)
### BUGGY CODE ###

import math


N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [1000000000] * N

# 初期条件
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    for j in range(1, K + 1):
        if i - j < 0:
            break

        dp[i] = min(
            dp[i],
            dp[i - j] + abs(h[i] - h[i - j])
        )

print(dp[N - 1])



### FIXED CODE ###

import numpy as np


N, K = map(int, input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N, 10 ** 10)

# 初期条件
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    ik = max(0, i - K)
    dp[i] = np.min(dp[ik:i] + np.abs(h[i] - h[ik:i]))

print(int(dp[-1]))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
A = tuple([int(input()) for _ in range(M)])
s = [0 for _ in range(N + 1)]
s[0] = 1
if 1 not in A:
  s[1] = 1

for n in range(2, N+1):
  if n in A:
    continue
  else:
    s[n] = s[n-1] + s[n-2]
print(s[-1] % (10 ** 9 + 7))


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
A = set([int(input()) for _ in range(M)])
s = [0 for _ in range(N + 1)]
s[0] = 1
if 1 not in A:
  s[1] = 1

for n in range(2, N+1):
  if n in A:
    continue
  else:
    s[n] = s[n-1] + s[n-2]
print(s[-1] % (10 ** 9 + 7))
### BUGGY CODE ###

from collections import defaultdict
N, M = map(int, input().split())

d = defaultdict(list)

for _ in range(N):
    A, B = map(int, input().split())
    d[A].append(B)

works = []
for k in range(M, 0, -1):
    d[k] = sorted(d[k], reverse=True)
    if M-k+1 >= 1:
        works.extend(d[k][:M-k+1])
        works = sorted(works, reverse=True)
        works = works[:M-k+1]
        # print(works)

works = sorted(works, reverse=True)

print(sum(works[:M]))


### FIXED CODE ###

# from collections import defaultdict
import heapq
N, M = map(int, input().split())

W = []
for _ in range(N):
    W.append(tuple(map(int, input().split())))
W = sorted(W, key=lambda x: (x[0], -x[1]))


a = []
heapq.heapify(a)  # リストaのheap化

ans = 0
c = 0
for day in range(1, M+1):
    day_c = 0
    while c != N and W[c][0] == day:
        if day_c <= M-day:
            x = W[c][1]
            heapq.heappush(a, -x)  # heap化されたリストaに要素xを追加
            day_c += 1
        c += 1
    if len(a) >= 1:
        ans += -heapq.heappop(a)  # heap化されたリストaから最小値を削除＆その最小値を出力

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

### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def resolve():
    readline=sys.stdin.readline
    mod=10**9+7
    n=int(readline())
    arr=list(map(int, readline().rstrip().split()))
    ans=0
    for i in range(n-1):
        for j in range(i+1,n):
            ans+=arr[i]^arr[j]
            ans%=mod
    print(ans)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

### FIXED CODE ###

### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def resolve():
    readline=sys.stdin.readline
    mod=10**9+7
    n=int(readline())
    arr=list(map(int, readline().rstrip().split()))
    binArr = [[0 for i in range(60)] for j in range(n)]
    cnt=[0]*60
    for i in range(n):
        b = bin(arr[i])[2:]
        lenb = len(b)
        for j in range(lenb):
            binArr[i][j] = int(b[lenb-1-j])
            cnt[j]+=binArr[i][j]
    ans=[0]*60
    answer = 0
    for i in range(n):
        for j in range(60):
            # 1: cnt[j]
            # 0: n-cnt[j]
            cnt[j]-=binArr[i][j]
            if binArr[i][j] == 0:
                ans[j] += cnt[j]
            else:
                ans[j] += (n-cnt[j]-i-1)
    x=1
    for i in range(60):
        answer += ans[i]*x
        answer %= mod
        x*=2
        x%=mod
    print(answer)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------
### BUGGY CODE ###

#coding:utf-8
D,G=map(int,input().split(" "))
Problem=[]
Comp={}
n=0
for i in range(D):
  p,c=map(int,input().split(" "))
  n+=p
  [Problem.append(100*(i+1)) for _ in range(p)]
  Comp[i+1]=[p,c]
Min=1000000000
for i in range(2**(n)):
  score=0
  Clear=[]
  for j in range(n):
    if ((i>>j)&1):
      score+=Problem[j]
      Clear.append("○")
    else:
      Clear.append("×")
  No=1
  Count=0
  mark_count=0
  for bin in Clear:
    if bin=="○":
      mark_count+=1
    Count+=1
    if Count==Comp[No][0]:
      if mark_count==Comp[No][0]:
      	score+=Comp[No][1]
      No+=1
      Count=0
      mark_count=0
  Mark_all=Clear.count("○")
  if score>=G:
    Mark_all=Clear.count("○")
    Min=min([Min,Mark_all])
print(Min)

### FIXED CODE ###

#coding:utf-8
D,G=map(int,input().split(" "))
Comp={}
for i in range(D):
  p,c=map(int,input().split(" "))
  Comp[i]=[p,c]
Min=1000000000
for i in range(2**(D)):
  answer=0
  score=0
  Clear=[]
  for j in range(D):
    if ((i>>j)&1):
      score+=(j+1)*100*Comp[j][0]
      score+=Comp[j][1]
      answer+=Comp[j][0]
      Clear.append(j+1)
  No=D
  Count=0
  while score<G and No>=1:
    if No in Clear or Count==Comp[No-1][0]:
      Count=0
      No-=1
    score+=100*No
    Count+=1
    answer+=1
  if score>=G:
    Min=min(Min,answer)
print(Min)
### BUGGY CODE ###

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

sl = sorted(ll,reverse=True)
count=0

for i1 in range(len(sl)-2):
  for i2 in range(i1+1,len(sl)-1):
    for i3 in range(i2+1,len(sl)):
      if sl[i1] < sl[i2] + sl[i3]:        
        count+=1

print(count)        

### FIXED CODE ###

from bisect import bisect_left
n = int(input())
ll = list(map(int,input().split()))

ls = sorted(ll)
count = 0
for i in range(n-1):
  for j in range(i+1,n-1):
    x = bisect_left(ls,ls[i]+ls[j])
    count += x-j-1
    
print(count)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(H: int, W: int, A: "List[List[int]]", B: "List[List[int]]"):
    L = 160*80
    base = [[None]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            base[h][w] = abs(A[h][w]-B[h][w])

    table = [[set() for _ in range(W)] for _ in range(H)]
    table[0][0].add(base[0][0])
    table[0][0].add(-base[0][0])
    for h in range(H):
        for w in range(W):
            if h > 0:
                for i in table[h-1][w]:
                    table[h][w].add(abs(i+base[h][w]))
                    table[h][w].add(abs(i-base[h][w]))
            if w > 0:
                for i in table[h][w-1]:
                    table[h][w].add(abs(i+base[h][w]))
                    table[h][w].add(abs(i-base[h][w]))
    print(min(table[H-1][W-1]))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [[int(next(tokens)) for _ in range(W)]
         for _ in range(H)]  # type: "List[List[int]]"
    B = [[int(next(tokens)) for _ in range(W)]
         for _ in range(H)]  # type: "List[List[int]]"
    solve(H, W, A, B)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(H: int, W: int, A: "List[List[int]]", B: "List[List[int]]"):
    base = [[abs(A[h][w]-B[h][w]) for w in range(W)] for h in range(H)]
    mx = (1 << 12800) - 1
    table = [[0]*W for _ in range(H)]
    table[0][0] = (1 << (6400 + base[0][0])) | (1 << (6400-base[0][0]))
    for h in range(H):
        for w in range(W):
            if h > 0:
                table[h][w] |= (table[h-1][w] << base[h][w])
                table[h][w] |= (table[h-1][w] >> base[h][w])
            if w > 0:
                table[h][w] |= (table[h][w-1] << base[h][w])
                table[h][w] |= (table[h][w-1] >> base[h][w])
            table[h][w] &= mx

    m = INF
    for j in range(12800):
        i = (table[H-1][W-1] >> j) & 1
        if i == 1:
            m = min(m, abs(j-6400))
    print(m)
    # print(table[H-1])

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [[int(next(tokens)) for _ in range(W)]
         for _ in range(H)]  # type: "List[List[int]]"
    B = [[int(next(tokens)) for _ in range(W)]
         for _ in range(H)]  # type: "List[List[int]]"
    solve(H, W, A, B)


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

import sys
sys.setrecursionlimit(250000)
from collections import defaultdict

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

nl = [[] for _ in range(N + 1)]
for a, b in [tuple(map(int, input().split())) for _ in range(N - 1)]:
    nl[a].append(b)
    nl[b].append(a)

val = defaultdict(int)
for p, x in [tuple(map(int, input().split())) for _ in range(Q)]:
    val[p] += x

ans = [0 for _ in range(N + 1)]


def dfs(v, p, cnt):
    cnt += val[v]
    ans[v] = cnt
    for next_v in nl[v]:
        if next_v != p:
            dfs(next_v, v, cnt)


dfs(1, -1, 0)
c = [0 for _ in range(N + 1)]
print(' '.join([str(a) for a in ans[1:]]))


### FIXED CODE ###

from collections import defaultdict

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

nl = [[] for _ in range(N + 1)]
for a, b in [tuple(map(int, input().split())) for _ in range(N - 1)]:
    nl[a].append(b)
    nl[b].append(a)
nl[0].append(1)

val = defaultdict(int)
for p, x in [tuple(map(int, input().split())) for _ in range(Q)]:
    val[p] += x

ans = [0 for _ in range(N + 1)]

stack = list()
stack.append((0, -1, 0))
while len(stack) > 0:
    v, p, cnt = stack.pop()
    cnt += val[v]
    ans[v] = cnt
    for next_v in nl[v]:
        if next_v != p:
            stack.append((next_v, v, cnt))

print(' '.join([str(a) for a in ans[1:]]))
### BUGGY CODE ###

import numpy as np
N = int(input())
S = input()
 
l_r = [i for i, s in enumerate(S) if s=='R']
l_g = [i for i, s in enumerate(S) if s=='G']
l_b = [i for i, s in enumerate(S) if s=='B']
 
ans = len(l_r)*len(l_g)*len(l_b)

for r in l_r:
  for g in l_g:
    mi = min(r, g)
    ma = max(r, g)
    l = ma - mi
    if ma+l in l_b:
      ans -= 1
    if mi-l in l_b:
      ans -= 1
    if l%2==0 and l//2 + mi in l_b:
      ans -= 1

print(ans)

### FIXED CODE ###

import numpy as np
N = int(input())
S = input()

l_r = set()
l_g = set()
l_b = set()
for i in range(N):
  if S[i]=='R':
    l_r.add(i)
  if S[i]=='G':
    l_g.add(i)
  if S[i]=='B':
    l_b.add(i)

ans = len(l_r)*len(l_g)*len(l_b)

for r in l_r:
  for g in l_g:
    mi = min(r, g)
    ma = max(r, g)
    l = ma - mi
    if ma+l in l_b:
      ans -= 1
    if mi-l in l_b:
      ans -= 1
    if l%2==0 and l//2 + mi in l_b:
      ans -= 1

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

import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd

def main():
    n,k=map(int,input().split())
    ar=list(map(int,input().split()))
    prod=1
    for i in range(k):
        prod*=ar[i]
    for i in range(k,n):
        x=prod*ar[i]//ar[i-k]
        if x>prod:
            print('Yes')
        else:
            print('No')
        prod=x




BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


if __name__ == "__main__":
    main()



### FIXED CODE ###

from math import log2
n,k=map(int,input().split())
ar=list(map(int,input().split()))
for i in range(n):
    ar[i]=log2(ar[i])
prod=0
for i in range(k):
    prod+=ar[i]
for i in range(k,n):
    x=prod+ar[i]-ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x