Harryxun/stf_run huggingface dataset:
s=input()
n=int(s)
c=0
for i in range(len(s)):
  for j in range(i,len(s)):
    m=(n/(10**i))%(10**j)
    if m%2019==0:
      c+=1
print(c)

### FIXED CODE ###

S = input()
N = len(S)
A = [int(S[i]) for i in range(N)]
A = A[::-1]

MOD = 2019

p10 = [1] * N
for i in range(1, N):
	p10[i] = (p10[i - 1] * 10) % MOD

for i in range(N):
	A[i] = (A[i] * p10[i]) % MOD

cumsum = [A[0]] * N
for i in range(1, N):
	cumsum[i] = (cumsum[i - 1] + A[i]) % MOD

cnt = [0] * MOD
cnt[0] = 1
for i in range(N):
	cnt[cumsum[i]] += 1

ans = 0
for i in range(MOD):
	ans += cnt[i] * (cnt[i] - 1) // 2

print(ans)
x,a,b=[int, input for i range(3)]
c=x-a
print(c%b)

### FIXED CODE ###

x,a,b=[int(input()) for i in range(3)]
c=x-a
print(c%b)
import string
x=input()
a=string.acsii_lowercase
for i in a
  if a not in x:
    print(x)
    exit()


### FIXED CODE ###

import string
S = str(input())
a = set(S)
b = set(string.ascii_lowercase)
c = b - a
if len(list(c)) == 0:
    print(None)
else:
    print(sorted(list(c))[0])
def f(u, i, d, t, vis):
    if vis[u]:
        return
    vis[u] = True
    z = t[u]

    c = 1
    for v in z:
        if vis[v]:
            continue
        if c == i:
            c += 1
        d[u].update({v: c})
        f(v, c, d, t, vis)
        c += 1


def main():
    from collections import defaultdict
    n = int(input())
    t = [[] for _ in range(n + 1)]
    m = []

    for _ in range(n - 1):
        i, j = map(int, input().split())
        t[i].append(j)
        t[j].append(i)
        m.append([i, j])
    d = defaultdict(dict)
    vis = [False for _ in range(n + 1)]
    f(1, len(t[1]) + 1, d, t, vis)

    ans = ''
    if t.count([]) == n:
        ans += str(n - 1) + '\n'
    else:
        ans += str(max(len(i) for i in t)) + '\n'

    for (u, v) in m:
        ans += str(d[u][v]) + '\n'

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def f(u, i, d, t, vis):
    if vis[u]:
        return
    vis[u] = True
    z = t[u]

    c = 1
    for v in z:
        if vis[v]:
            continue
        if c == i:
            c += 1
        d[u].update({v: c})
        f(v, c, d, t, vis)
        c += 1


def main():
    from collections import defaultdict
    import sys
    sys.setrecursionlimit(100000)
    n = int(input())
    t = [[] for _ in range(n + 1)]
    m = []

    for _ in range(n - 1):
        i, j = map(int, input().split())
        t[i].append(j)
        t[j].append(i)
        m.append([i, j])
    d = defaultdict(dict)
    vis = [False for _ in range(n + 1)]
    f(1, len(t[1]) + 1, d, t, vis)

    ans = ''
    if t.count([]) == n:
        ans += str(n - 1) + '\n'
    else:
        ans += str(max(len(i) for i in t)) + '\n'

    for (u, v) in m:
        ans += str(d[u][v]) + '\n'

    print(ans)


if __name__ == '__main__':
    main()
a, s, = map(input().split())

if a >= '3200':
    print(s)
if a < '3200':
    print('red')

### FIXED CODE ###

a = input()
s = input()
if a >= '3200':
    print(s)
if a < '3200':
    print('red')
A, B, C = input().split()
print('YES'  if A[-1] == B[0] and B[-1] == C[0])

### FIXED CODE ###

A, B, C = input().split()
print('YES'  if A[-1] == B[0] and B[-1] == C[0] else 'NO')
s = input()
x, y = map(int, input().split())
command = s.split("T")

command_length = len(command)
x_command = command_length // 2
y_command = command_length // 2
if command_length % 2 != 0:
    x_command += 1

dpx = [[False for _ in range(8000 + 1)] for _ in range(x_command + 1)]
dpx[0][4000] = True
dpy = [[False for _ in range(8000 + 1)] for _ in range(y_command + 1)]
dpy[0][4000] = True

for i in range(1, x_command + 1):
    f = len(command[2 * (i - 1)])
    for j in range(f, 8000 + 1 - f):
        if dpx[i - 1][j - f] or dpx[i - 1][j + f]:
            dpx[i][j] = True

for i in range(1, y_command + 1):
    f = len(command[2 * (i - 1) + 1])
    for j in range(f, 8000 + 1 - f):
        if dpy[i - 1][j - f] or dpy[i - 1][j + f]:
            dpy[i][j] = True

if dpx[x_command][4000 + x] and dpy[y_command][4000 + y]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s = input()
x, y = map(int, input().split())
command = s.split("T")

command_length = len(command)

x_command = []
y_command = []
for i in range(command_length):
    c = len(command[i])
    if i % 2 == 0:
        x_command.append(c)

    else:
        y_command.append(c)
x -= x_command.pop(0)
x_command.sort(reverse=True)
y_command.sort(reverse=True)

c_x = 0
c_y = 0
for c in x_command:
    if x - c_x >= 0:
        c_x += c
    else:
        c_x -= c

for c in y_command:
    if y - c_y > 0:
        c_y += c
    else:
        c_y -= c
if c_x == x and c_y == y:
    print("Yes")
else:
    print("No")
def gcd(a,b):
    if(b == 0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b):
    return (a*b)//gcd(a,b)
n = int(input())
mod = 1e9 + 7
a = [int(i) for i in input().split()]
ans = 1    
for i in a:
    ans = lcm(ans,i)

print(sum(ans//i for i in a)%mod)


### FIXED CODE ###

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
n=int(input())
mod=1000000007
s=[int(i) for i in input().split()]
ans=1
for i in s:
    ans*=i//gcd(ans,i)
print(sum(ans//i for i in s)%mod)
import bisect
import math

n,m = map(int,input().split())
a = [int(i) for i in input().split()]

a.sort(reverse=True)

ans=[math.ceil(-a[0]/2)]
num = 0
now = 1

if n == 1:
    print(a[0] // 2**m)
    exit()
    
for i in range(m-1):
    #print(ans[0],a[now],now,ans)
    if now >= n:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
    if ans[0] <= -a[now]:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
    else:
        ans.append(math.ceil(-a[now]/2))
        now += 1
print(ans,ans,ans,ans)
exit()
        
if len(ans) == len(a):
    print(-sum(ans))
    exit()
        
print(-sum(ans)+sum(a[len(ans):]))
exit()
for i in range(1,n):
 if num >= m:
   break
 if -a[i]>=ans[-1]: #i番目の要素がansの最小値以下であればansに付け加える
   ans.append(-a[i]//2)
   num+=1
 else:
   pos=bisect.bisect_right(ans,-a[i]) #i番目の要素以下の値で、最も大きい値の位置を求める
   ans[pos]=-a[i] #その位置の値をi番目の要素と置き換える

print(ans)
print(-sum(ans))
exit()

a = [-a]
print(a)
exit()

tmp = a[0] // 2

del a[0]

idx = bisect.bisect_right(a,tmp)
a.insert(idx,tmp)
print(a,idx)
exit()

if a[0] >= a[1]:
    a[0] = a[0] // 2
else:
    a[1] = a[1] // 2
    
print(a)

### FIXED CODE ###

import bisect
import math

n,m = map(int,input().split())
a = [int(i) for i in input().split()]

a.sort(reverse=True)

ans=[math.ceil(-a[0]/2)]
num = 0
now = 1

if n == 1:
    print(a[0] // 2**m)
    exit()
    
for i in range(m-1):
    #print(ans[0],a[now],now,ans)
    if now >= n:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
        continue
    if ans[0] <= -a[now]:
        tmp = math.ceil(ans[0] / 2)
        idx = bisect.bisect_right(ans,tmp)
        #print(ans,idx,tmp)
        ans.insert(idx,tmp)
        del ans[0]
    else:
        ans.append(math.ceil(-a[now]/2))
        now += 1
#print(ans,ans,ans,ans)
        
if len(ans) == len(a):
    print(-sum(ans))
    exit()
        
print(-sum(ans)+sum(a[len(ans):]))
exit()
for i in range(1,n):
 if num >= m:
   break
 if -a[i]>=ans[-1]: #i番目の要素がansの最小値以下であればansに付け加える
   ans.append(-a[i]//2)
   num+=1
 else:
   pos=bisect.bisect_right(ans,-a[i]) #i番目の要素以下の値で、最も大きい値の位置を求める
   ans[pos]=-a[i] #その位置の値をi番目の要素と置き換える

print(ans)
print(-sum(ans))
exit()

a = [-a]
print(a)
exit()

tmp = a[0] // 2

del a[0]

idx = bisect.bisect_right(a,tmp)
a.insert(idx,tmp)
print(a,idx)
exit()

if a[0] >= a[1]:
    a[0] = a[0] // 2
else:
    a[1] = a[1] // 2
    
print(a)
n = raw_input()
S = map(int, raw_input().split())
q = raw_input()
T = map(int, raw_input().split())

def BinarySearch(list, num):
	#print list
	l = len(list)
	if l == 1 and list[0] != num:
		#print("*0")
		return 0
	else:
		if list[l/2] == num:
			#print("*1")
			return 1
		elif list[l/2] < num:
			#print("*2")
			return BinarySearch(list[l/2+1:], num)
		else:
			#print("*3")
			return BinarySearch(list[:l/2], num)

cnt = 0
for i in T:
	#print("*4")
	#print BinarySearch(S, i)
	cnt += BinarySearch(S, i)
	#print cnt

print cnt

### FIXED CODE ###

n = raw_input()
S = map(int, raw_input().split())
q = raw_input()
T = map(int, raw_input().split())

def BinarySearch(list, num):
	left = 0
	right = len(list) - 1
	while left <= right:
		mid = (left + right) / 2
		#print("left = {:}".format(left))
		#print("mid = {:}".format(mid))
		#print("right = {:}".format(right))
		#print("")
		if list[mid] == num:
			return 1
		elif list[mid] < num:
			left = mid + 1
			#print("left = {:}".format(left))
			#print("mid = {:}".format(mid))
			#print("right = {:}".format(right))
			#print("")
		else:
			right = mid - 1
			#print("left = {:}".format(left))
			#print("mid = {:}".format(mid))
			#print("right = {:}".format(right))
			#print("")
	return 0

cnt = 0
for i in T:
	cnt += BinarySearch(S, i)

print cnt
from sys import stdin

N, M = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(stdin.readline().rstrip()) for _ in range(M)]
fib = [1, 1]
for k in range(N):
    fib.append((fib[-1] + fib[-2]) % 1000000007)
ans = fib[a[0] - 1]
for l in range(M - 1):
    if a[l + 1] - a[l] == 1:
        print(0)
        exit()
    ans = ans * fib[a[l + 1] - a[l] - 2]
ans = ans * fib[N - a[-1] - 1]
print(ans % 1000000007)


### FIXED CODE ###

from sys import stdin

N, M = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(stdin.readline().rstrip()) for _ in range(M)]
fib = [1, 1]
for k in range(N):
    fib.append((fib[-1] + fib[-2]) % 1000000007)
if M == 0:
    print(fib[N])
    exit()
ans = fib[a[0] - 1]
for l in range(M - 1):
    if a[l + 1] - a[l] == 1:
        print(0)
        exit()
    ans = ans * fib[a[l + 1] - a[l] - 2]
ans = ans * fib[N - a[-1] - 1]
print(ans % 1000000007)
from collections import defaultdict
depth = [0 for _ in range(10**5+10)]
tree = defaultdict(list)
def dfs(v,p,d):
    depth[v] = d
    for u in tree[v]:
        if u[0] == p:continue
        dfs(u[0],v,d+u[1])
def main():
    N = int(input())
    for _ in range(N-1):
        a,b,c = map(int,input().split())
        a -= 1
        b -= 1
        tree[a] += [[b,c]]
        tree[b] += [[a,c]]
    Q,K = map(int,input().split())
    K -= 1
    dfs(K,-1,0)
    Ans = []
    for _ in range(Q):
        x,y = map(int,input().split())
        x -= 1
        y -= 1
        ans = depth[x]+depth[y]
        Ans.append(ans)
    for ans in Ans:
        print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import defaultdict,deque
def main():
    N = int(input())
    depth = [-1 for _ in range(N)]
    tree = defaultdict(list)
    for _ in range(N-1):
        a,b,c = map(int,input().split())
        a -= 1
        b -= 1
        tree[a] += [[b,c]]
        tree[b] += [[a,c]]
    Q,K = map(int,input().split())
    K -= 1
    stack = deque([K])
    depth[K] = 0
    while stack:
        v = stack.popleft()
        for e in tree[v]:
            u,c = e
            if u == K:
                continue
            if depth[u] == -1:
                stack.appendleft(u)
                depth[u] = depth[v] + c

    for _ in range(Q):
        x,y = map(int,input().split())
        x -= 1
        y -= 1
        ans = depth[x]+depth[y]
        print(ans)

if __name__ == "__main__":
    main()
X = int(input())

sft = [3,5,7]

if x in sft:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

X = int(input())

sft = [3,5,7]

if X in sft:
  print("YES")
else:
  print("NO")
import math

def a(xs, m):
    k = xs.index(m) + 1
    ops = []
    a = xs[0];
    for i in range(1, len(xs)):
        b = xs[i]
        if a > b:
            d = a - b
            n = int(math.ceil(d / float(m)))
            d2 = m - b
            n2 = int(math.ceil(d2 / float(m)))
            if n2 > 0 and n2 < n:
                b += n2 * m
                ops.append((k, i + 1, n2))
                k = i + 2
                m = b
                d = b - a
                n = int(math.ceil(d / float(m)))
            b += n * m
            ops.append((k, i + 1, n))
        a = b
    return ops

def b(xs, m):
    k = xs.index(m) + 1
    ops = []
    a = xs[-1]
    for i in range(len(xs) - 2, -1, -1):
        b = xs[i]
        if a < b:
            d = a - b
            n = int(math.ceil(d / float(m)))
            d2 = m - b
            n2 = int(math.ceil(d2 / float(m)))
            if n2 > 0 and n2 < n:
                b += n2 * m
                ops.append(k, i, n2)
                k = i + 1
                m = b
                d = a - b
                n = int(math.ceil(d / float(m)))
            b += n * m
            ops.append((k, i, n))
        a = b
    return ops

n = input()
xs = map(int, raw_input().split())
M = max(xs)
m = min(xs)
if M > 0 and m >= 0:
    ops = a(xs, M)
    c = len(ops)
elif M <= 0 and m < 0:
    ops = b(xs, m)
    c = len(ops)
else:
    ops1 = a(xs, M)
    ops2 = b(xs, m)
    c1 = 0
    for _, _, n in ops1: c1 += n
    c2 = 0
    for _, _, n in ops2: c2 += n
    if c1 <= c2:
        ops = ops1
        c = c1
    else:
        ops = ops2
        c = c2
print c
for a, b, n in ops:
    for _ in range(n):
        print a, b


### FIXED CODE ###

def a(xs):
    k = 0
    m = 0
    ops = []
    for i, x in enumerate(xs):
        if x > m:
            k = i
            m = x
    for i, x in enumerate(xs):
        if xs[i] < 0:
            xs[i] += m
            ops.append((k, i))
    for i in range(len(xs) - 1):
        if xs[i] > xs[i + 1]:
            xs[i + 1] += xs[i]
            ops.append((i, i + 1))
    return ops

def b(xs):
    k = 0
    m = 0
    ops = []
    for i, x in enumerate(xs):
        if x < m:
            k = i
            m = x
    for i, x in enumerate(xs):
        if xs[i] > 0:
            xs[i] += m
            ops.append((k, i))
    for i in range(len(xs) - 2, -1, -1):
        if xs[i] > xs[i + 1]:
            xs[i] += xs[i + 1]
            ops.append((i + 1, i))
    return ops
            
n = input()
xs = map(int, raw_input().split())
m = min(xs)
M = max(xs)
if abs(M) >= abs(m):
    ops = a(xs)
else:
    ops = b(xs)
print len(ops)
for a, b in ops:
    print a + 1, b + 1
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
for i in B:
    if i % 3 == 0 or i % 5 == 0:
         bcount += 1
if acount != bcount:
    print('DENIED')
elif account == 0:
    print('DENIED')
else:
    print('APPROVED')

### FIXED CODE ###

N = int(input())
A = list(map(int , input().split()))
ans = []
bns = []
for i in A:
    if i % 2 == 0:
        ans.append(i)
for i in ans:
    if i % 3 == 0 or i % 5 == 0:
        bns.append(i)
if len(ans) == len(bns):
    print('APPROVED')
else:
    print('DENIED')
n,m=map(int,input().split())
a=list(map(int,input().split()))
bc=[list(map(int,input().split())) for i in range(m)]
a.sort()
bc.sort(key=lambda x: x[1],reverse=True)
# print(a)
# print(bc)
i=0
for b,c in bc:
  tb=b
  while tb>0:
    if a[i]>=c:
      break
    a[i]=c
    tb-=1
    i+=1
  if a[i]>=c:
    break
print(sum(a))

### FIXED CODE ###

# ABC127 D-Integer Cards
from operator import itemgetter
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

A.sort()
BC.sort(key=itemgetter(1),reverse=True)
# print(A)
# print('sort',BC)
c = 0
for i in range(M):
    for j in range(BC[i][0]):
        if A[c] < BC[i][1]:
            A[c] = BC[i][1]
        else:
            print(sum(A))
            exit()
        c += 1
        if c == N:
            print(sum(A))
            exit()
# for i in range(M):
#     x = 0
#     while x < BC[i][0]:
#         A.sort()
#         print(i,A)
#         if BC[i][1] > A[0]:
#             A[0] = BC[i][1]
#         x += 1 
print(sum(A))
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

X = int(input())
nshina = X // 100
kingaku = X - nshina * 100
# print(kingaku)

is_exist = False
for i0 in range(nshina):
    for i1 in range(nshina - i0):
        for i2 in range(nshina - i0 - i1):
            for i3 in range(nshina - i0 - i1 - i2):
                for i4 in range(nshina - i0 - i1 - i2 - i3):
                    # print(nshina, i0, i1, i2, i3, i4, (nshina - i4 - i3 - i2 - i1 - i0))
                    # print(i1 + i2 * 2 + i3 * 3 + i4 * 4 + (nshina-i4-i3-i2-i1-i0) * 5)
                    if i1 + i2 * 2 + i3 * 3 + i4 * 4 + (nshina-i4-i3-i2-i1-i0) * 5 == kingaku:
                        print(1)
                        exit()

print(0)

### FIXED CODE ###

import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

X = int(input())
nshohin = X // 100
amari = X % 100

print(0 if nshohin * 5 < amari else 1)
from sys import stdin
n,m = map(int, stdin.readline().rstrip().split())

count = 0
penalty = 0
qb = [0]*n
was = [0]*n

for i in range(m):
    p,s = map(str,stdin.readline().rstrip().split())
    p = int(p)
    if s == "AC" and qb[p-1] != "AC":
        qb[p-1] = "AC"
        pentalty += was[p-1]
        count += 1
    elif s == "WA":
        was[p-1] += 1
    else:
        pass

print(count, penalty)

### FIXED CODE ###

from sys import stdin
n,m = map(int, stdin.readline().rstrip().split())

count = 0
penalty = 0
qb = [0]*n
was = [0]*n

for i in range(m):
    p,s = map(str,stdin.readline().rstrip().split())
    p = int(p)
    if s == "AC" and qb[p-1] != "AC":
        qb[p-1] = "AC"
        penalty += was[p-1]
        count += 1
    elif s == "WA":
        was[p-1] += 1
    else:
        pass

print(count, penalty)
n = int(input())
ans = 0
for num in range(1, n):
    if num%2 == 1:
        continue
    ls = []
    for i in range(num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1, N+1):
  num = 0
  if i%2 == 1:
    for j in range(1, i+1):
      if i%j == 0:
        num += 1
    if num == 8:
      ans += 1
print(ans)
N = int(input())
i =0
ans =0

while i < N:
    a = int(input())
    b = int(input())

    ans += b - a +1
    i += 1
print(ans)

### FIXED CODE ###

N = int(input())
i =0
ans =0

while i < N:
    a = input().split()
    ans += int(a[1]) - int(a[0]) +1
    i = i + 1
print(ans)
S = input().split()
T = input().split()

ans = 0

if S[0] == T[0] :
	ans += 1

elif S[1] == T[1] :
	ans += 1

elif S[2] == T[2] :
	ans += 1

print(ans)

### FIXED CODE ###

S = input()
T = input()

ans = 0

if S[0] == T[0] :
	ans += 1

if S[1] == T[1] :
	ans += 1

if S[2] == T[2] :
	ans += 1

print(ans)
n = int(input())
a = list(map(int, input().split()))
s = ([0]*100)
a.sort()
for i in a:
    s[i] += 1
ans = 0
for j in range(100):
    if s[j] == 1:
        ans += 1
    if s[j] > 0:
        for k in range(j, 100, j):
            s[k] = 0
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = ([0]*1000001)
a.sort()
for i in a:
    s[i] += 1
ans = 0
for j in range(1000001):
    if s[j] == 1:
        ans += 1
    if s[j] > 0:
        for k in range(j, 1000001, j):
            s[k] = 0
print(ans)
n=int(input())
A=list(map(int, input().split())).insert(0, 0)
B=[0]*(n+1)
for i in range(n, 0, -1):
  if sum([B[j] for j in range(i, n+1, i)])&1!=A[i]:
    B[i]+=1
res=[]
for i in range(n):
  if B[i]==1:
    res.append(i)
print(len(res))
if res:
  print(" ".join([str(e) for e in res]))
    

### FIXED CODE ###

n=int(input())
A=[0]+list(map(int, input().split()))
B=[0]*(n+1)
B[n//2+1:]=A[n//2+1:]
for i in range(n//2, 0, -1):
  B[i]=(sum([B[j] for j in range(2*i, n+1, i)])+A[i])&1
res=[]
for i in range(n+1):
  if B[i]==1:
    res.append(i)
print(len(res))
if res:
  print(*res)
_, *e = [[*map(int, t.split())] for t in open(0)]
ans = 1
mod = 10 ** 9 + 7
slope_dict = {}
zeros = 0
vect_x = 0
for x, y in e:
    if x == y == 0:
        zeros += 1
    elif y == 0:
        vect_x += 1
    else:
        slope_dict[x/y] = slope_dict.get(x/y, 0) + 1
ans = ans * (pow(2, vect_x, mod) + pow(2, slope_dict.get(0, 0), mod) - 1) % mod
slope_dict.popitem(0)
for k in slope_dict:
    if -1/k in slope_dict:
        if k >= 1:
            ans = ans * (pow(2, slope_dict[k], mod) +
                         pow(2, slope_dict[-1/k], mod) - 1) % mod
    else:
        ans = ans * (pow(2, slope_dict[k], mod)) % mod
print(ans + zeros - 1 % mod)


### FIXED CODE ###

from math import gcd
from collections import defaultdict
mod = 10**9+7
_, *S = open(0)
mp = defaultdict(lambda: [0, 0])
O = 0
for s in S:
    a, b = map(int, s.split())
    if a == b == 0:
        O += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0 or a == 0 < b:
            a, b = -a, -b
        f = 0
        if b < 0:
            a, b, f = -b, a, 1
        mp[(a, b)][f] += 1
ans = 1
for k in mp:
    x, y = mp[k]
    ans = ans*(pow(2, x, mod)+pow(2, y, mod)-1) % mod
print((ans+O-1) % mod)
n,a_start,b_start,a_goal,b_goal = map(int,input().split())
s = input()

no_rock_double = True
for i in range(a_start, b_goal):
    if i < n:
        if s[i] == '#' and s[i+1] == '#':
            no_rock_double = False
can_switch = False
if a_goal > b_goal:
    for i in range(b_start+1, b_goal):
        if i + 1 < n:
            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
                can_switch = True
if a_goal > b_goal:
    if no_rock_double and can_switch:
        print('Yes')
    else:
        print('No')
else:
    if no_rock_double:
        print('Yes')
    else:
        print('No')



### FIXED CODE ###

n,a_start,b_start,a_goal,b_goal = map(int,input().split())
s = input()

no_rock_double = True
for i in range(a_start, max(b_goal,a_goal)):
    if i+1 < n:
        if s[i] == '#' and s[i+1] == '#':
            no_rock_double = False
can_switch = False
if a_goal > b_goal:
    for i in range(b_start-1, b_goal):
        if s[i - 1:i + 2] == "...":
            can_switch = True
    if no_rock_double and can_switch:
        print('Yes')
    else:
        print('No')
else:
    if no_rock_double:
        print('Yes')
    else:
        print('No')
N = input()
print(N * N * N)

### FIXED CODE ###

N1 = int(input())
print(N1 ** 3)
n,k=map(int,input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=10**9
for i in range(n-k+1):
    ans=min(ans,max(h[i:i+k])-min(h[i:i+k]))
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans=10**9
for i in range(n-k+1):
    ans=min(ans,h[i+k-1]-h[i])
print(ans)