Harryxun/stf_run huggingface dataset:
#! /usr/bin/python
# -*- encoding: utf-8 -*-

import sys

if __name__ == '__main__':
    inputN = int(input())
    inputList = list(map(int, input().split()))
    #
    flag = False
    before = 0
    for k in range(inputN):
        if before >= inputList[k]:
            flag = True
        before = inputList[k]
    
    #
    if not flag:
        print("YES")
        sys.exit()
    
    #  
    for i in range(inputN):
        for j in range(inputN):
            if i != j:
                changeList = inputList[:]
                swap = changeList[i]
                changeList[i] = changeList[j]
                changeList[j] = swap
          
                #
                flag = False
                before = 0
                for k in range(inputN):
                    if before >= changeList[k]:
                        flag = True
                    before = changeList[k]
          
                #
                if not flag:
                    print("YES")
                    sys.exit()


print("NO")
          
    
    
    

### FIXED CODE ###

#! /usr/bin/python
# -*- encoding: utf-8 -*-

import sys

if __name__ == '__main__':
    inputN = int(input())
    inputList = list(map(int, input().split()))
    #
    flag = False
    before = 0
    for k in range(inputN):
        if before >= inputList[k]:
            flag = True
        before = inputList[k]
    
    #
    if not flag:
        sys.stdout.write("YES")
        sys.exit()
    
    #  
    for i in range(inputN):
        for j in range(inputN):
            if i != j:
                changeList = inputList[:]
                swap = changeList[i]
                changeList[i] = changeList[j]
                changeList[j] = swap
          
                #
                flag = False
                before = 0
                for k in range(inputN):
                    if before >= changeList[k]:
                        flag = True
                    before = changeList[k]
          
                #
                if not flag:
                    sys.stdout.write("YES")
                    sys.exit()


    sys.stdout.write("NO")
from sys import stdin

def main():
  read = stdin.readline
  A,B = list(read().split(" "))
  B = B*100
  c = int(A) * B
  print(c//100)
  
  
  
if __name__ == "__main__":
  main()

### FIXED CODE ###

from sys import stdin

def main():
  read = stdin.readline
  A,B = list(read().split(" "))
  B = 100*int(B[0]) + 10*int(B[2]) + 1 * int(B[3])
  c = int(A) * B
  print(c//100)
  
  
  
if __name__ == "__main__":
  main()
a, b= map(int, input().split())
print(6-a-b)

### FIXED CODE ###

a = int(input())
b = int(input())
print(6-a-b)
n = int(input())
if n%1000!=0:
    print(min(1000-(n%1000)))
else:
    print("0")

### FIXED CODE ###

n = int(input())
if n%1000!=0:
    print(1000-(n%1000))
else:
    print("0")
import sys
from fractions import gcd
from collections import defaultdict as dd
from bisect import bisect_left as bl
input = sys.stdin.readline
N, X, D = map(int, input().split())
if D == 0:
  if X == 0: print(1)
  else: print(N + 1)
  exit(0)
a = dd(list)
a[0].append((0, 0))
d = abs(D) // abs(gcd(X, D))
#print(d)

for i in range(1, N + 1):
  l = X * i + D * i * (i - 1) // 2
  r = X * i + D * (i * N - i * (i + 1) // 2)
  if r < l: l, r = r, l
  a[i % d].append((l, r))

res = 0
for x in range(d):
  s = set()
  for l, r in a[x]:
    s.add(l)
    s.add(r)
    s.add(r + 1)
  xs = sorted(s)
  table = [0] * (len(xs) + 1)
  for l, r in a[x]:
    ll = bl(xs, l)
    rr = bl(xs, r + 1)
    table[ll] += 1
    table[rr] += -1
  for i in range(len(xs)): table[i + 1] += table[i]
  l = xs[0]
  for i in range(len(xs)):
    if table[i]:
      if l == -1: l = xs[i]
      continue
    res += (xs[i - 1] - l) // abs(D) + 1
    l = -1
    #print(res, xs[i - 1], l)
  
  #print(table, xs)
#print(a)
print(res)

### FIXED CODE ###

import sys
from fractions import gcd
from collections import defaultdict as dd
from bisect import bisect_left as bl
input = sys.stdin.readline
N, X, D = map(int, input().split())
if D == 0:
  if X == 0: print(1)
  else: print(N + 1)
  exit(0)
a = dd(list)
a[0].append((0, 0))
d = abs(D) // abs(gcd(X, D))
#print(d)

for i in range(1, N + 1):
  l = X * i + D * i * (i - 1) // 2
  r = X * i + D * (i * N - i * (i + 1) // 2)
  if r < l: l, r = r, l
  a[i % d].append((l, r))

res = 0
for x in a.keys():
  s = set()
  for l, r in a[x]:
    s.add(l)
    s.add(r)
    s.add(r + 1)
  xs = sorted(s)
  table = [0] * (len(xs) + 1)
  for l, r in a[x]:
    ll = bl(xs, l)
    rr = bl(xs, r + 1)
    table[ll] += 1
    table[rr] += -1
  for i in range(len(xs)): table[i + 1] += table[i]
  l = xs[0]
  for i in range(len(xs)):
    if table[i]:
      if l == -1: l = xs[i]
      continue
    res += (xs[i - 1] - l) // abs(D) + 1
    l = -1

print(res)
N, M = map(int, input().split())
d=[[] for i in range(N)]
for i in range(M):
    b, c = map(int, input().split())
    l[b-1].append(c-1)
    l[c-1].append(b-1)
a=0
while True:
    count = 0
    for i in range(N):
        if len(d[i]) == 1:
            d[d[i][0]].remove(i)
            d[i]=[]
            count += 1
        if count == 0:
            break
        a+=count
print(a)

### FIXED CODE ###

n,m=map(int,input().split())
l=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)
a=0
while 1:
    x=0
    for i in range(n):
        if len(l[i])==1:
            l[l[i][0]].remove(i)
            l[i]=[]
            x+=1
    if x==0:break
    a+=x
print(a)
N = int(input())
A = list(map(int,input().split()))
ans = [0] * N
for i, a in enumerate(A):
  ans[a-1] = i+1
print(' '.join(ans))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = [0] * N
for i, a in enumerate(A):
  ans[a-1] = i+1
print(*ans)
s = input()

if s.count(a[0]) == 2 and a.count(a[1])==2 and a.count(a[2])==2:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()

if s.count(s[0]) == 2 and s.count(s[1])==2 and s.count(s[2])==2:
    print("Yes")
else:
    print("No")
N = int(input())
se = [()] * N
for i in range(N):
	x, l = map(int, input().split())
	se[i] = (x-l, x+l)
se = sorted(se, key=lambda x: x[1])
ans = N
for i in range(1, N):
	if se[i-1][1] > se[i][0]:
		se[i][1] = se[i-1][1]
		ans -= 1
print(ans)

### FIXED CODE ###

N = int(input())
se = [[]] * N
for i in range(N):
	x, l = map(int, input().split())
	se[i] = [x-l, x+l]
se = sorted(se, key=lambda x: x[1])
ans = N
for i in range(1, N):
	if se[i-1][1] > se[i][0]:
		se[i][1] = se[i-1][1]
		ans -= 1
print(ans)
s = input()
p = ""

if(s.endswith("s")){
  p = s + "es"
}else{
  p = s + "s"
}

print(s)

### FIXED CODE ###

s = input()
p = ""

if(s.endswith("s")):
  p = s + "es"
else:
  p = s + "s"

print(p)
n = int(input())
x = [input() for i in range(n)]

ans = 1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans = -1

print(ans)

### FIXED CODE ###

n=int(input())
x=list(map(int, input().split()))
 
ans=1
if 0 in x:
  ans=0
else:
  for i in x:
    ans=ans*i
    if ans>10**18:
      ans=-1
      break
print(ans)
from collections import deque

S = input()
Q = int(input())
Query = [input().split() for _ in range(Q)]

S1 = deque('')
S2 = deque('')
rev = False

for TFC in Query:
    if TFC[0] == '1':
        rev = not rev
    else:
        if TFC[1] == '1':
            if rev:
                S2.append(TFC[2])
            else:
                S1.appendleft(TFC[2])
        else:
            if rev:
                S1.appendleft(TFC[2])
            else:
                S2.append(TFC[2])
if rev:
    S2 = ''.join(S2[::-1])
    S1 = ''.join(S1[::-1])
    print(S2 + S + S1)
else:
    S1 = ''.join(S1)
    S2 = ''.join(S2)
    print(S1 + S + S2)

### FIXED CODE ###

S = input()
Q = int(input())
Query = [input().split() for _ in range(Q)]

rev = False
S1 = ''
S2 = ''

for TFC in Query:
    if TFC[0] == '1':
        rev = not rev
    else:
        if TFC[1] == '1':
            if rev:
                S2 += TFC[2]
            else:
                S1 = TFC[2] + S1
        else:
            if rev:
                S1 = TFC[2] + S1
            else:
                S2 += TFC[2]

if rev:
    print(S2[::-1] + S[::-1] + S1[::-1])
else:
    print(S1 + S + S2)
from collections import defaultdict
def main():
    def f(n):
        if n == 0:
            return 0
        if d[n] != 0:
            return d[n]
        d[n] = f(n % sum(list(map(int, bin(n)[2:])))) + 1
    def rev(i):
        if X[i] == '0':
            print(d[b % (c + 1)] + 1 if (b := (m + (1 << (n - i - 1)))) != 0 else 0)
        else:
            print(d[b % (c - 1)] + 1 if (b := (m - (1 << (n - i - 1)))) != 0 else 0)

    n = int(input())
    X = list(input())
    d = defaultdict(int)
    d[0] = 0
    for i in range(1, n):
        f(i)
    c = sum(list(map(int, X)))
    m = int(''.join(X), 2)
    for i in range(n):
        rev(i)

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    def f(n):
        if n == 0: return 0
        return f(n % bin(n).count('1')) + 1
    n = int(input())
    X = list(input())
    c = sum(list(map(int, X)))
    m = int(''.join(X), 2)
    mp, mm = m % (c + 1), m % (c - 1) if c - 1 != 0 else 0
    jp, jm = 1, 1
    ans = [0] * n
    for i in range(n - 1, -1, -1):
        if X[i] == '0':
            mod = c + 1
            ans[i] = f((mp + jp) % mod) + 1
        else:
            ans[i] = f((mm - jm + mod) % mod) + 1 if (mod := c - 1) != 0 else 0
        jp, jm = (jp << 1) % (c + 1), (jm << 1) % (c - 1) if c - 1 != 0 else 0
    [print(a) for a in ans]
if __name__ == '__main__':
    main()
N,M,K=map(int,input().split())
O=10**9+7
f=lambda n:1if n<1else n*f(n-1)%O;
print(f(N*M-2)*pow(6*f(N*M-K)*f(K-2),O-2,O)*N*M*(N*M-1)*(N+M)%O)

### FIXED CODE ###

N,M,K=map(int,input().split())
O,S,T=10**9+7,N+M,6
for i in range(K):S=S*(N*M-i)%O;T=T*-~i%O
print(S*K*~-K*pow(T,O-2,O)%O)
n, d = map(int, input().split())

if n%(2d+1) == 0:
  print(n%(2d+1))
else:
  print(n%(2d+1)+1)
  

### FIXED CODE ###

a,b=(int(x) for x in input().split())

c = a//(2*b+1)


if a % (2*b+1) ==0:
  print(c)
  
else:
  print(c+1)
N = int(input())
A = [int(i) for i in input().split()]
max_A = max(A)
if sum(A.remove(max_A)) > max(A):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
max_A = max(A)
A.remove(max_A)
if sum(A) > max_A:
    print("Yes")
else:
    print("No")
import  pandas as pd
N=list(range(1,int(input())+1))
df=pd.DataFrame(N,columns=["moto"])
df["3"]=df["moto"]%3
df["5"]=df["moto"]%5
print(df[(df['3']!=0) & (df['5']!=0)]["moto"].sum())

### FIXED CODE ###

import numpy as np
N=list(range(1,int(input())+1))
a=np.asarray(N,dtype='int64')
b=a%3
c=a%5
d=np.array([a,b,c])
d=np.delete(d, np.where(d==0)[1], axis=1)
print(np.sum(d[0]))
# -*- coding:utf-8 -*-
import sys
sys.setrecursionlimit(10000)

def preDatasets(q):
	line = input()
	print(line)
	datas[q] = line
	return datas

def dfs(x, y, sym):
	tile[x][y] = '.'
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			if not tile[i][j] == '.':
				if tile[i][j] == '@':
					dfs(i, j, '@')
					res += 1
				elif tile[i][j] == '#':
					dfs(i, j, '#')
					res += 1
				elif tile[i][j] == '*':
					dfs(i, j, '*')
					res += 1
	print(res)

index = 0	
counter=0
datas = [[0 for i in range(1)]for j in range(1)] 
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
while True:
	line = input()
	
	if ' ' in line:
		N = int(datas[index].split(' ')[0])
		M = int(datas[index].split(' ')[1])
		tile = [[0 for i in range(N)]for j in range(M)]

	if N == 0:
		break

	if not counter<=M:
		for i in range(len(tile)):
			tile[i] = list(datas[index+i+1])
		solve()
		index += N+1

	counter+=1

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
from collections import Counter

N = int(input())
S = input()

if N == 1 or N == 2:
    ans = 0
else:
    c = Counter(S)
    tmp = c.most_common()
    rgb = tmp[0][1] * tmp[1][1] * tmp[2][1]

    count = 0
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            k = 2 * j - i
            if k >= N:
                break 
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                count += 1
    ans = rgb - count

print(ans)

### FIXED CODE ###

N = int(input())
S = input()

if N == 1 or N == 2:
    ans = 0
else:
    R = S.count('R')
    G = S.count('G')
    B = S.count('B')
    rgb = R * G * B

    count = 0
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            k = 2 * j - i
            if k >= N:
                break 
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                count += 1
    ans = rgb - count

print(ans)
import math
input_line = input().split()
H, A = map(int, input_line())
print(math.ceil(H/A))


### FIXED CODE ###

import math
input_line = input().split()
H, A = map(int, input_line)
print(math.ceil(H/A))
import collections
import math
MOD = 998244353

n = int(input())
d = [int(_) for _ in input().split()]

ans = 1
if not d[0]  == 0:
    ans = 0
else:
    D = sorted(collections.Counter(d).most_common())
    for i in range(1, max(d)+1):
        ans = ans * pow(D[i-1][1], D[i][1], MOD)
print(ans)

### FIXED CODE ###

import collections
MOD = 998244353

n = int(input())
d = [int(_) for _ in input().split()]

ans = 1
if d[0] != 0:
    ans = 0
else:
    D = sorted(collections.Counter(d).most_common())
    if D[0][1] != 1:
        ans = 0
    else:
        cnt = 0
        prev = 1
        for i in D:
            if i[0] == cnt:
                ans = ans * pow(prev, i[1], MOD) % MOD
                prev = i[1]
            else:
                ans = 0
                break
            cnt += 1
print(ans)
import math

a,b=map(int,input().split())

def factorization(n):
  arr=[]
  temp=n
  for i in range(2,int(math.sqrt(n))+1):
    if temp % i == 0:
      cnt = 0
      while temp % i == 0:
        cnt += 1
        temp /= int(i)
      arr.append(i)
    if temp != 1:
      arr.append(temp)
    return arr
d=math.gcd(a,b)
print(len(factorization(d))+1)
    
               


### FIXED CODE ###

from fractions import gcd

a,b=map(int,input().split())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    return arr
  
d = gcd(a,b)
print(len(factorization(d)) + 1)
from collections import defaultdict
import sys
input = sys.stdin.readline

N, M = [int(item) for item in input().split()]
A = [int(item) for item in input().split()]
# A.sort()

new_dict = defaultdict(lambda: 0)
for i in range(M):
    b, c = [int(item) for item in input().split()]
    new_dict[c] += b
new_dict = sorted(new_dict.items(), key=lambda x: -x[0])

new_list = []
i = 0
for k, v in new_dict:
    new_list.extend([k] * v)
    i += v
    if i >= N:
        break
new_list = new_list[:N]

A.extend(new_list)
A.sort()
A.reverse()

"""
n = min(N, len(new_list))
for i in range(n):
    if A[i] >= new_list[i]:
        break
    A[i] = new_list[i]
"""

print(sum(A[:N]))


### FIXED CODE ###

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

N, M = [int(item) for item in input().split()]
A = [int(item) for item in input().split()]
A.sort()

new_dict = defaultdict(lambda: 0)
for i in range(M):
    b, c = [int(item) for item in input().split()]
    new_dict[c] += b
new_dict = sorted(new_dict.items(), key=lambda x: -x[0])

new_list = []
for k, v in new_dict:
    if v > N:
        v = N
    new_list += [k] * v
    if len(new_list) >= N:
        break

new_list = new_list[:N]

#####

n = min(N, len(new_list))
for i in range(n):
    if A[i] >= new_list[i]:
        break
    A[i] = new_list[i]

print(sum(A))
a,b=map(int, input().split())
if a < b:
    print("a < b")
elif a == b:
    print("a == b")
else:
    print("a > b")


### FIXED CODE ###

a,b = map(int, input().split())
if a < b:
  print('a < b')
elif a > b:
  print('a > b')
elif a == b:
  print('a == b')
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")

if len(word) > num:
    print("...")

### FIXED CODE ###

num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")
    if i+1 >= len(word):
        break

if len(word) > num:
    print("...")
N = int(input())
K = int(input())
x = []
for i in range(N):
    x.append([int(i) for i in input().split()])

ans = 0
for i in range(N):
    if(abs(K-x[i]) >= x[i]):
        ans += x[i]
    else:
        ans += abs(K-x[i])
        
print(ans)

### FIXED CODE ###

N = int(input())
K = int(input())
x = [int(i) for i in input().split()]

ans = 0
for i in range(N):
    if(abs(K-x[i]) >= x[i]):
        ans += x[i]
    else:
        ans += abs(K-x[i])

print(ans*2)
S=list(input())
flag=0
Ccount=0
Lcount=0
Cnumber=-1
if S[0]=="A":
  flag+=1
  del S[0]
if S.count("C")==1:
  flag+=1
  del S[Cnumber]
N=len(S)
if S[0:].islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

### FIXED CODE ###

S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")
n=int(input())
a=[[]]*4
s,h,c,d=[],[],[],[]
for i in range(n)
    m,r=input().split()
    if m == 'S'
        s.append(int(r))
     elif m == 'H'
        s.append(int(r))
     elif m == 'C'
        s.append(int(r))
     elif m == 'D'
        s.append(int(r))
for i in range(1,14):
    if i not in s:
        print('S', str(i))
for i in range(1,14):
    if i not in h:
        print('H', str(i))
for i in range(1,14):
    if i not in c:
        print('C', str(i))
for i in range(1,14):
    if i not in d:
        print('D', str(i))

### FIXED CODE ###

n=int(input())
s,h,c,d=[],[],[],[]

for i in range(n):
    m,r=input().split()
    if m == 'S':
        s.append(int(r))
    elif m == 'H':
        h.append(int(r))
    elif m == 'C':
        c.append(int(r))
    elif m == 'D':
        d.append(int(r))

for i in range(1,14):
    if i not in s:
        print('S', str(i))
for i in range(1,14):
    if i not in h:
        print('H', str(i))
for i in range(1,14):
    if i not in c:
        print('C', str(i))
for i in range(1,14):
    if i not in d:
        print('D', str(i))
def main():
    
    n = int(input())

    n_list = []
    for i in range(n):
        a_list = []
        a = int(input())
        for j in range(a):
            x,y = map(int, input().split())
            x -= 1
            a_list.append([x,y])
        if a == 0:
            a_list.append([0])
        n_list.append(a_list)

    #print(n_list)
    ans = [0]
    for j in range(0,2**n):
        tmp = bin(j)
        tmp = str(int(tmp[2:])).zfill(n)
        #print('tmp')
        #print(tmp)
        
        
        break_on = 0
        for k in range(n):
            if tmp[k] == '1':
                for h in n_list[k]:
                    #print('########')
                    #print(k)
                    #print(h[1])
                    #print(tmp[h[0]])
                    if h[1] != int(tmp[h[0]]):
                        break_on = 1
                        break
                if break_on == 1:
                    break
            if break_on == 1:
                break
            
            if tmp[k] == '0':
                continue
        
        if break_on == 0:
            #print('tmp.count()')
            #print(tmp.count('1'))
            ans.append(tmp.count('1'))
    
    #print(ans)
    print(max(ans))
    


            



if __name__ == '__main__':
    main()



### FIXED CODE ###


def main():
    
    n = int(input())

    n_list = []
    for i in range(n):
        a_list = []
        a = int(input())
        for j in range(a):
            x,y = map(int, input().split())
            x -= 1
            a_list.append([x,y])
        if a == 0:
            a_list.append([0])
        n_list.append(a_list)

    #print(n_list)
    ans = [0]
    for j in range(0,2**n):
        tmp = bin(j)
        tmp = str(int(tmp[2:])).zfill(n)
        #print('tmp')
        #print(tmp)
        
        
        break_on = 0
        for k in range(n):
            if tmp[k] == '1':
                #print(n_list[k])
                if n_list[k][0] != [0]:
                    for h in n_list[k]:
                        #print('########')
                        #print(k)
                        #print(h[1])
                        #print(tmp[h[0]])
                        if h[1] != int(tmp[h[0]]):
                            break_on = 1
                            break
                    if break_on == 1:
                        break
            if break_on == 1:
                break
            
            if tmp[k] == '0':
                continue
        
        if break_on == 0:
            #print('tmp.count()')
            #print(tmp.count('1'))
            ans.append(tmp.count('1'))
    
    #print(ans)
    print(max(ans))
    


            



if __name__ == '__main__':
    main()
import math
n = int(input())

def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)

num = factorial(n)

ans = 1
for i in range(2, n+1):
    count = 0
    while num % i == 0:
        count += 1
        num = num // i
    ans *= (count + 1)

print(ans % (10 ** 9 + 7))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
n = int(input())

def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)

num = factorial(n)

ans = 1
for i in range(2, n+1):
    count = 0
    while num % i == 0:
        count += 1
        num = num // i
    ans *= (count + 1)

print(ans % (10 ** 9 + 7))
from collections import defaultdict
import copy
import sys
s = input()
n_s = len(s)
t = input()
n_t = len(t)

chr_firstind = defaultdict(lambda:-1)
chr_nextind = defaultdict(lambda:-1)
i_to_chr_nextind = [0] * n_s
for i in range(n_s-1,-1,-1):
    chr_firstind[s[i]] = i
    i_to_chr_nextind[i] = copy.copy(chr_nextind)
    chr_nextind[s[i]] = i 

first_target = t[0]
previous_ind = chr_firstind[first_target]
if previous_ind == -1:
    print(-1)
    sys.exit()
if n_t == 1:
    print(first_ind+1)
    sys.exit()
s_used = 0
for i in range(1,n_t):
    # 一つ前のtarget_indを使って、次のtargetのs内でのindexを求める
    d = i_to_chr_nextind[previous_ind]
    next_ind = d[t[i]]
    if next_ind == -1:
        s_used += 1
        next_ind = chr_firstind[t[i]]
        if next_ind == -1:
            print(-1)
            sys.exit()
    previous_ind = next_ind
print(n_s*s_used+previous_ind+1)




### FIXED CODE ###

from collections import defaultdict
import copy
import sys
s = input()
n_s = len(s)
t = input()
n_t = len(t)

chr_firstind = defaultdict(lambda:-1)
chr_nextind = defaultdict(lambda:-1)
i_to_chr_nextind = [0] * n_s
for i in range(n_s-1,-1,-1):
    chr_firstind[s[i]] = i
    i_to_chr_nextind[i] = copy.copy(chr_nextind)
    chr_nextind[s[i]] = i 

first_target = t[0]
previous_ind = chr_firstind[first_target]
if previous_ind == -1:
    print(-1)
    sys.exit()
if n_t == 1:
    print(previous_ind+1)
    sys.exit()
s_used = 0
for i in range(1,n_t):
    # 一つ前のtarget_indを使って、次のtargetのs内でのindexを求める
    d = i_to_chr_nextind[previous_ind]
    next_ind = d[t[i]]
    if next_ind == -1:
        s_used += 1
        next_ind = chr_firstind[t[i]]
        if next_ind == -1:
            print(-1)
            sys.exit()
    previous_ind = next_ind
print(n_s*s_used+previous_ind+1)