Harryxun/stf_run huggingface dataset:
N=int(input())
lst=[0]
mod=10**9+7

for i in range(N):
  a=int(input())
  if lst[-1]==a:#直前と同じ色はlstに入れない（圧縮）
    continue　
  else:
    lst.append(a)
#今、lstのindexと石の個数は等しい
    
length=len(lst)

#全色のリストL、初期値０にしておく
#DPをDP[0]を１に、残りlength-1個を０にしたリストとする
L=[0]*(2*10**5+1)
DP=[0]*(length-1)
DP.insert(0,1)
for i in range(1,length):
  if L[lst[i]]==0:#色がまだ出ていないとき
    DP[i]=DP[i-1]%mod
    L[lst[i]]=i#色のリストLに今のindexを記録
  else:#同じ色が出ているとき
    j=L[lst[i]]#直前の色のindexはj
    DP[i]=(DP[i-1]+DP[j])%mod
    L[lst[i]]=i#色のリストLに今のindexを記録
print(DP[-1])


### FIXED CODE ###

N=int(input())
lst=[0]
mod=10**9+7
for i in range(N):
  a=int(input())
  if lst[-1]==a:
    continue
  else:
    lst.append(a)
length=len(lst)
L=[0]*(2*10**5+1);DP=[0]*(length-1)
DP.insert(0,1)
for i in range(1,length):
  if L[lst[i]]==0:
    DP[i]=DP[i-1]%mod
    L[lst[i]]=i
  else:
    j=L[lst[i]]
    DP[i]=(DP[i-1]+DP[j])%mod
    L[lst[i]]=i
print(DP[-1])
loop do
  n =gets.to_i
  break if n==-1
end

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
N = int(input())
A = list(map(int,input().split(" ")))
A.sort()
used = [0] * N
pow2_set = reversed([ 1<<i for i in range(36)])
ans = 0

for pow2 in pow2_set:
    l,r = 0,N-1
    while l < r:
        count += 1
        if A[l] + A[r] < pow2:
            l += 1
        elif A[l] + A[r] == pow2:
            if used[l] == 0 and used[r] == 0:
                ans += 1
                used[l],used[r] = 1,1
            else:
                if used[l] == 1:
                    l += 1
                if used[r] == 1:
                    r -= 1
        else:
            r -= 1

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split(" ")))
A.sort()
used = [0] * N
pow2_set = reversed([ 1<<i for i in range(36)])
ans = 0
for pow2 in pow2_set:
    l,r = 0,N-1
    while l < r:
        if A[l] + A[r] < pow2:
            l += 1
        elif A[l] + A[r] == pow2:
            if used[l] == 0 and used[r] == 0:
                ans += 1
                used[l],used[r] = 1,1
            else:
                if used[l] == 1:
                    l += 1
                if used[r] == 1:
                    r -= 1
        else:
            r -= 1
 
print(ans)
from bisect import *
N,M=map(int,input().split())
kagi=[]
for i in range(M):
    a,b=map(int,input().split())
    C=list(map(int,input().split()))
    for i in range(b):
        C[i]-=1
    kagi.append([a,set(C)])

value=10**7
idx=-1
for i in range(M):
    if 0 in kagi[i][1] and kagi[i][0]<value:
        value=kagi[i][0]
        idx=i
if idx==-1:
    print(-1)
    exit()
kagilst=[idx]

takara=[set() for i in range(N)]
for m in range(M):
    for k in kagi[m][1]:
        takara[k].add(m)

for n in range(1,N):
    if [k for k in kagilst if n in kagi[k][1]]:
        continue
    tempvalue=10**7
    for k in takara[n]:
        lst=[0 for i in range(n)]
        for z in kagilst+[k]:
            for m in kagi[z][1]:
                if m<len(lst):
                    lst[m]=1
        for i in range(len(kagilst)**2):
            A=bin(i)[:2]
            A=list(reversed(list(A)))
            for i in range(len(A)-len(kagilst)):
                A.append("0")
            for a in range(len(kagilst)):

                if A[a]=="1":
                    for h in kagi[kagilst[a]][1]:
                        if h<len(lst):
                            lst[h]=1
            if not 0 in lst:
                temptempvalue=value+sum([kagi[a][0] for a in range(len(kagilst)) if A[a]=="1"])+kagi[k][0]
                if temptempvalue<tempvalue:
                    tempvalue=temptempvalue
                    tempkagi=k
    if tempvalue==10**7:
        print(-1)
        exit()
    value=tempvalue
    kagilst.append(k)
print(value)


### FIXED CODE ###

from bisect import *
N,M=map(int,input().split())
kagi=[]
for i in range(M):
    a,b=map(int,input().split())
    C=list(map(int,input().split()))
    value=0
    for i in range(b):
        C[i]-=1
        value+=2**C[i]

    kagi.append([a,value])


dp=[[10**8 for i in range(2**N)] for m in range(M+1)]
dp[0][0]=0
for i in range(M):
    for s in range(2**N):
        dp[i+1][s]=min(dp[i][s],dp[i+1][s])
        dp[i+1][s|kagi[i][1]]=min(dp[i+1][s|kagi[i][1]],dp[i][s]+kagi[i][0])
if 10**8==dp[M][-1]:
    print(-1)
else:
    print(dp[M][-1])
n = int(input())
f = 4
s = 7

for i in range(n):
    for n in range(n):
        if s + f == n:
            ans = 1
            break

if ans:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

n = int(input())
if n <= 3:
    print("No")
elif n == 5:
    print("No")
elif n == 6:
    print("No")
elif n == 9:
    print("No")
elif n == 10:
    print("No")
elif n == 13:
    print("No")
elif n == 17:
    print("No")    
else:
    print("Yes")
def f(x):
  if x==0:
    return 0
  elif x==1:
    return 1
  elif x==2:
    if S[0]==S[1]:
      return 1
    else:
      return 2
  else:
    if S[x-1]==S[x-2]:
      return f(x-3)+2
    else:
      return f(x-1)+1
  
S=input()
print(f(len(S)))
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
def f(x):
  if x<=2:
    if x==2 and S[0]==S[1]:
      return 1
    else:
      return x
  else:
    if S[x-1]==S[x-2]:
      return f(x-3)+2
    else:
      return f(x-1)+1
S=input()
print(f(len(S)))
A,B=map(int, input().split())
print(ceil((B-1)/(A-1)))

### FIXED CODE ###

import math
A,B=map(int, input().split())
print(math.ceil((B-1)/(A-1)))
s = str(input())
j = len(s)
l = []
for i in range(j):
    for ii in range(i, j):
        ss = int(s[i:ii + 1])
        sss = ss / 2019
        if sss.is_integer():
            l.append(ss)

print(len(l))


### FIXED CODE ###

s = input()[::-1]

cnts = [0] * 2019
cnts[0] = 1

n, d = 0, 1

for char in s:
    n = (n + int(char) * d) % 2019
    d = d * 10 % 2019
    cnts[n] += 1

ans = 0
for cnt in cnts:
    ans += cnt * (cnt - 1) // 2

print(ans)
N = int(input())
l = [int(i) for i in input().split()]

l = sorted(l)

sema = True
for i in range(len(l)):
    for j in range(i + 1,len(l)):
        if not l[j] % l[i] == 0:
            sema = False
            break
pre = min(l)
if sema == True:
    print(pre)
else:
    m = l[1] % l[0]
    for i in range(2, len(l)):
        a = l[i] % m
        if a < m and a >= 1:
            m = a
        else:
            print(m)

### FIXED CODE ###

# import math
from functools import reduce
input()
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def gcds(*numbers):
    return reduce(gcd, numbers)
print(gcds(*[int(i) for i in input().split()]))
import math
k = int(input())
ans = 0

for a in range(k):
    for b in range(k):
        d = math.gcd(a + 1, b + 1)
        for c in range(k):
            ans += math(d, c + 1)

print(ans)


### FIXED CODE ###

import math
k = int(input())
ans = 0

for a in range(k):
    for b in range(k):
        d = math.gcd(a + 1, b + 1)
        for c in range(k):
            ans += math.gcd(d, c + 1)

print(ans)
n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=[]
while i<n:
 num.append(int(input()))
 i=i+1
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
print(min,max,g)


### FIXED CODE ###

n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=list(map(int,input().split()))
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
 i+=1
print(min,max,g)
import math
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

### FIXED CODE ###

from fractions import gcd
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // gcd(x, y)
print(lcm(a, b))
from itertools import product

N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]

A = [0, 1]
combnation = list(product(A, repeat=Q))
abcd.sort()

ans = 0
for comb in combnation:
    print(comb)
    comb_list = [abcd[i] for i, k in enumerate(comb) if k==1]
    check = True
    A = [0 for i in range(N+1)]
    amount = 0
    for a, b, c, d in comb_list:
        amount += d
        if A[a] == 0 and A[b] == 0:
            if A[a] == 0 and A[b] == 0:
                A[a] = 1
                A[b] = 1 + c
    
        elif A[a] == 0 and A[b] != 0:
            if A[b] - c >= 1:
                A[a] = A[b] - c
            else:
                check = False
                break
    
        elif A[a] != 0 and A[b] == 0:
            if c + A[a] <= M:
                A[b] = A[a] + c
            else:
                check = False
                break
        else:
            if A[b] - A[a] != c:
                check = False
                break
    
    if check and amount > ans:
        ans = amount
print(ans)

### FIXED CODE ###

import math
A, B, N = map(int, input().split())

if N < B:
    if N % B == 0:
        x = N-1
    else:
        x = N

else:
    if N % B == 0:
        x = B-1
    else:
        x = B-1

ans = math.modf((x/B))[0]*A
print(int(ans))
x = input()
y = input()

int(x,y)

print(x*y,x*2+y*2)

### FIXED CODE ###

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

print(a*b,a*2+b*2)
from math import factorial

def cmb(n, r):
    a = factorial(n) / factorial(r) / factorial(n - r)
    return a

bignum = 1000000007

N,K = map(int,input().split())
R = N - K

for i in range(1,K+1):
    tmp = cmb(R+1,i) * cmb(K-1,i-1)
    print(int(tmp) % bignum)

### FIXED CODE ###

import math

def combi(n ,k):
    return math.factorial(n)//(math.factorial(k)*math.factorial(n-k))

N,K = map(int,input().split())
R = N - K

for i in range(1,K+1):
    if R + 1 >= i:
        tmp = combi(R+1,i) * combi(K-1,i-1)
    else:
        tmp = 0
    print(tmp % (10**9+7))
N=int(input())
#G=[set() for _ in [0]*N]
G=[[]for i in range(N)]
#print(G)
u=[]
v=[]
w=[]
for i in range(N-1):
    a,b,c=map(int,input().split())
    a-=1
    b-=1

    G[a].append((b,c))
    G[b].append((a,c))

#print(G)
#print(G)
ans=[-1]*N
#ルートでは親はいないから-1
q=[(0,0,-1)]
"""
Q=[(0,0,-1)]
a,b,c=Q.pop()
print(a)
print(b)
print(c)
"""
"""
#print(q)
while q:
    #v：現在見ている点
    #p：vの親のノード
    #d：距離
    v,d,p=q.pop()
    if d%2==0:
        ans[v]=0
    else:
        ans[v]=1
    ans[v]=d
    for u,w in G[v]:
        #逆流を防ぐ
        if u==p:
            continue
        if w%2==0:
            pass
        else:
            d=1-d
        q.append((u,d,v))
    #print(q)
"""
def dfs(v,p,c):
    ans[v]=c
    #print(G[v])
    for u,w in G[v]:
        if u==p:
            continue
        if w%2==0:
            dfs(u,v,c)
        else:
            dfs(u,v,1-c)
dfs(0,-1,1)
print("\n".join(map(str,ans)))

### FIXED CODE ###

import sys
 
n = int(input())
links = [set() for _ in [0] * n]
for line in sys.stdin:
    u, v, w = map(int, line.split())
    u -= 1
    v -= 1
    links[u].add((v, w))
    links[v].add((u, w))
ans = [-1] * n
q = [(0, 0, -1)]
while q:
    v, d, p = q.pop()
    if d % 2 == 0:
        ans[v] = 0
    else:
        ans[v] = 1
    for u, w in links[v]:
        if u == p:
            continue
        q.append((u, d + w, v))
print('\n'.join(map(str, ans)))
S,W = input()
    if S < W:
        print('unsafe')
    else:
    S > W:
        print('safe')

### FIXED CODE ###

s,w=map(int,input().split())
if s>w:
    print('safe')
else :
    print('unsafe')
def op_print(data,a,b):
    for i in range(a,b-1):
        print(data[i],end="")
    print()
def op_reverse(data,a,b):
    return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
    return data.replace(data[a:b],q) 

data = input()
q = int(input())
for _ in range(q):
    op = list(map(str,input().split()))
    if(op[0] == "print"):
        op_print(data,int(op[1]),int(op[2]))
    elif(op[0] == "reverse"):
        data = op_reverse(data,int(op[1]),int(op[2]))
    elif(op[0] == "replace"):
        data = op_replace(data,int(op[1]),int(op[2]),op[3])


### FIXED CODE ###

s=input()
for _ in range(int(input())):
    o=input().split()
    a,b=map(int,o[1:3]);b+=1
    c=o[0][2]
    if c=='p':s=s[:a]+o[3]+s[b:]
    elif c=='i':print(s[a:b])
    elif c=='v':s=s[:a]+s[a:b][::-1]+s[b:]
def gcd(x,y):
    if x>=y:
        if x%y==0:
            return y
        else:
            return gcd(y,x%y)
    else:
        if y%x==0:
            return x
        else:
            return gcd(x,y%x)
def gcd2(x4):
    if len(x4)>2:
        return gcd2([gcd(x4[0],x4[1]),]+x4[2:])
    elif len(x4) ==2:
        return gcd(x4[0],x4[1])
    else:
        return x4[0]
N, X = map(int,input().split())
x=[int(i) for i in input().split()]
x.append(X)
x3=[]
for i in range(len(x)-1):
    x3.append(abs(x[i+1]-x[i]))
print(gcd2(x3))


### FIXED CODE ###

H, W = map(int,input().split())
a=[]
N2=0
for i in range(H):
    b=[int(i) for i in input().split()]
    for j in range(W):
        if b[j]%2==1:
            N2+=1
    a.append(b)
if N2%2==1:
    N2-=1
N=0
N3=0
idou=1
if W==1:
    idou=2
c=0
i=0
j=0
s=[]
for k in range(H*W):
    if N3==N2:
        break
    if idou==1:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
            a[i][j+1]+=1
            a[i][j]-=1
            if a[i][j+1]%2==0:
                N3+=2
        j+=1
        if j==W-1-c:
            idou=2
    elif idou==2:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+2)+" "+str(j+1))
            a[i+1][j]+=1
            a[i][j]-=1
            if a[i+1][j]%2==0:
                N3+=2
        i+=1
        if i==H-1-c:
            idou=3
    elif idou==3:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j))
            a[i][j-1]+=1
            a[i][j]-=1
            if a[i][j-1]%2==0:
                N3+=2
        j-=1
        if j==c:
            idou=4
    elif idou==4:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i)+" "+str(j+1))
            a[i-1][j]+=1
            a[i][j]-=1
            if a[i-1][j]%2==0:
                N3+=2
        i-=1
        if i==c+1:
            idou=1
            c+=1
print(N)
for i in range(N):
    print(s[i])
n, m = map(int,input().split())

B = []
for i in range(n+1):
    onel = []
    for j in range(n+1):
        onel.append(0)
    B.append(onel)
    
visited_checklist = []

input_node = []

for i in range(n+1):
    visited_checklist.append(i)
    
for k in range(m):
    ai,bi = map(int,input().split())
    B[ai][bi] = 1
    B[bi][ai] = 1
    input_node.append([ai,bi])
    
def DFS(node):
    l[node] = 0
    for j in range(n+1):
        if X[node][j] == 1 or X[j][node] == 1 and l[j] != 0:
            l[j] = 0 
            X[node][j] == 0
            X[j][node] == 0
            DFS(j)
        if X[node][j] == 0 or X[j][node] == 0:
            continue
        if max(l) == 0:
            break
        if l[j] == 0:
            continue

    
count = 0

for i in input_node:
    X = B
    X[i[0]][i[1]] = 0
    X[i[1]][i[0]] = 0
    l = visited_checklist
    DFS(1)
    if max(l) != 0:
        count += 1
print(count)

### FIXED CODE ###

n,m = map(int,input().split())

H = [[0 for _ in range(n)] for _ in range(n) ]
edge_list = []

for _ in range(m):
    a, b = map(int,input().split())
    edge_list.append([a,b])
    H[a-1][b-1] = 1
    H[b-1][a-1] = 1
    
visited = [0 for _ in range(n)]

def dfs(node):
    visited[node] = 1
    for node_,edge_ in enumerate(H[node]):
        if edge_ == 1:
            if visited[node_] == 1:
                continue
            dfs(node_)
ans = 0
for _ in edge_list:
    H[_[0] -1][_[1] - 1] = 0
    H[_[1] -1][_[0] - 1] = 0
    
    dfs(1)
    if 0 in visited:
        ans += 1
    H[_[0] -1][_[1] - 1] = 1
    H[_[1] -1][_[0] - 1] = 1
    visited = [0 for _ in range(n)]
print(ans)
S = str(input())
Q = int(input())

qs = [input().split() for i in range(Q)]

for q in qs:
    if q[0] == '1':
        S = S[::-1]
    else:
        if q[1] == '1':
            S = q[2] + S
        else:
            S = S + q[2]

print(S)

### FIXED CODE ###

S = input()


if ('AB' in S) | ('BA' in S):
    print('Yes')
else:
    print('No')
n = int(input())
as = list(map(int, input().split()))

r = 0
i = 1
while True:
  for a in as:
    f = False
    if a%2 == 0:
      a /= 2
      r += 1
      f = True
    if not f:
      break
print(r)
  

### FIXED CODE ###

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

r = 0
i = 1

while True:
  f = False
  for a in aas:
    if a%2**i == 0:
      r += 1
      f = True
  if not f:
    break
  i += 1
print(r)
lst = input().split()

n = lst[0]
n = int(n)
s = lst[1]

if n % 2 == 1:
    print('NO')

t = s[0, n/2 + 1]

if t + t == s:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

lst = [input() for i in range(2)]

n = int(lst[0])
s = lst[1]
t = ''

for i in range(n//2):
    t += s[i]

if n % 2 == 1:
    print('No')
elif t + t == s:
    print('Yes')
else:
    print('No')
n, m = map(int, input().split())
adj = [[] for _ in range(m)]
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    adj[a].append(b)
    adj[b].append(a)
# print(adj)
from collections import deque
q = deque([0])
dist = [-1]*n
ans = [0]*n

while q:
    now = q.popleft()
    for to in adj[now]:
        if dist[to] != -1: continue
        # ans[to] = now 
        dist[to] = dist[now] + 1
        q.append(to)
    # print(adj[now], dist, ans, q)
    
print('Yes')
for i in range(1,n):
    print(dist[i]+1)



### FIXED CODE ###

n, m = map(int ,input().split())
 
adj = [[] for _ in range(n)]
 
for i in range(m):
    a, b = map(int, input().split())
    a-=1
    b-=1
    adj[a].append(b)
    adj[b].append(a)
 
from collections import deque
q = deque()
 
dist = [-1] * n
ans = [0] * n
 
q.append(0)
while len(q) != 0:
    now = q.popleft()
    for to in adj[now]:
        if dist[to] != -1:continue
        dist[to] = dist[now] + 1
        q.append(to)
        ans[to] = now
 
print("Yes")
for i in range(1, n):
    print(ans[i] + 1)
from collections import deque

s=list(input())
s=deque(s)
q=int(input())

re=False
for i in range(1,q+1):
    q_i=input().split()
    if q_i[0]=="1":
        re= not re
    else:
        if q_i[1]=="1" and re==False:
            s.appendleft(q_i[2])
        elif q_i[1]=="2" and re==True:
            s.appendleft(q_i[2])
        else:
            s.append(q_i[2])

if re==True:
    s=s[::-1]

s="".join(s)
print(s)

### FIXED CODE ###

from collections import deque

s=list(input())
s=deque(s)
q=int(input())

re=False
for i in range(1,q+1):
    q_i=input().split()
    if q_i[0]=="1":
        re= not re
    else:
        if q_i[1]=="1" and re==False:
            s.appendleft(q_i[2])
        elif q_i[1]=="2" and re==True:
            s.appendleft(q_i[2])
        else:
            s.append(q_i[2])

s=list(s)

if re==True:
    s=s[::-1]

s="".join(s)
print(s)
x,y = map(int,input().split().strip())
print(x*y)
print(2*(x+y))

### FIXED CODE ###

x,y = map(int,input().split())
s=x*y
p=2*(x+y)
print("%d %d"%(s,p))
N, M, X = map(int, input().split())
A = list(map(int,input().split()))
A.append(N)
for i in range(M):
  if A[0] > X or A[M-1] < X:
    print(0)
  else A[i] < X < A[i+1]:
    print(min(i+1, M-i-1))


### FIXED CODE ###

N, M, X = map(int, input().split())
A = list(map(int,input().split()))
for i in range(M-1):
  if A[0] > X or A[M-1] < X:
    print(0)
    break
  elif A[i] < X < A[i+1]:
    print(min(i+1, M-i-1))
    break
a = int(input())
b = int(input())
print(a*b)

### FIXED CODE ###

a,b = (int(x) for x in input().split())
print(a*b)
sum=0
for i in range(5):
  y=int(input())
  x=10-y%10
  min=min(10, x)
  if x==min:
    sum+=y
  else:
    sum+=y+x
print(sum)

### FIXED CODE ###

X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    color[number] += 1
left = 8 - color[:8].count(0)
right = color[8]
if left == 8:
    print('{} {}'.format(8,8))
else:
    sum_color = left + right
    if sum_color >= 8:
        print('{} {}'.format(left,8))
    else:
        print('{} {}'.format(left,sum_color))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    if number >=8:
        color[8] += 1
    else:
        color[number] += 1
left = 8 - color[:8].count(0) #3200未満が何種類あるか
right = color[8]              #3200以上が何人いるか
if left == 0:
    print('{} {}'.format(1,right))
else:
    sum_color = left + right
    print('{} {}'.format(left,sum_color))
_ = input().split(" ")
if 0<_[0]<10 and 0<_[1]<10:
  print(_[0]*_[1])
else:
  print(-1)

### FIXED CODE ###

num = [int(_) for _ in input().split(" ")]
if 0<num[0]<10 and 0<num[1]<10:
  print(num[0]*num[1])
else:
  print(-1)
x,y = map(int,input().split())

if y%2 == 0 and x*2<=y<=x*4:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

for i in range(5):
  if x[i] == 0:
    print(i+1)
import heapq
K, T = map(int, input().split())
L = list(map(lambda x: -int(x), input().split()))

heapq.heapify(L)

while L and len(L) > 1:
    a = heapq.heappop(L)
    b = heapq.heappop(L)
    r = b-a
    if r > 0:
        heapq.heappush(L, -r)
print(-heapq.heappop(L)-1)


### FIXED CODE ###

import heapq
K, T = map(int, input().split())
L = list(map(lambda x: -int(x), input().split()))

heapq.heapify(L)

while L and len(L) > 1:
    a = heapq.heappop(L)
    b = heapq.heappop(L)
    r = b-a
    if r > 0:
        heapq.heappush(L, -r)
if L:
    print(-heapq.heappop(L)-1)
else:
    print(0)
N, K = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)
H = sorted(H)
mi = 10**9
for i in range(N-K+1):
    _ = H[i+K] - H[i]
    if mi > _:
        mi = _
print(mi)

### FIXED CODE ###

N, K = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)
H = sorted(H)
mi = 10**9
for i in range(N-K+1):
    _ = H[i+(K-1)] - H[i]
    if mi > _:
        mi = _
print(mi)
N=int(input())
a=list(map(int, input().split()))
c=[0]*9
for i in range(N):
  c[a[i]//400]+=1
  
x=sum([1 for i in range(8) if c[i]>0])
y=min(8, x+c[8])

print(x, y)

### FIXED CODE ###

N=int(input())
a=list(map(int, input().split()))
c=[0]*9
for i in range(N):
  c[min(a[i]//400, 8)]+=1
  
temp=[1 for i in range(8) if c[i]>0]
x=len(temp)
y=x+c[8]
 
print(max(x, 1), y)
import collections

N = int(input())
S = [(sorted(input())) for _ in range(N)]
c = collections.Counter(S)
ans = 0
for i in set(S):
    n = c[i]
    ans += n*(n-1)//2
print(ans)

### FIXED CODE ###

import collections

N = int(input())
S = [''.join(sorted(input())) for _ in range(N)]
c = collections.Counter(S)
ans = 0
for i in set(S):
    n = c[i]
    ans += n*(n-1)//2
print(ans)
N, MOD = int(input()), 10**9+7
memo = [{} fot i in range(N+1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return  False
    return True

def dfs(cur, last3):
    #メモ化
    if last3 in memo[cur]:
        return memo[cur][last3]
    #最後までたどり着いた数列
    if cur == N:
        return 1
    #漸化式計算
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))

### FIXED CODE ###

N, MOD = int(input()), 10**9+7
memo = [{} for i in range(N+1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return  False
    return True

def dfs(cur, last3):
    #メモ化
    if last3 in memo[cur]:
        return memo[cur][last3]
    #最後までたどり着いた数列
    if cur == N:
        return 1
    #漸化式計算
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))