Harryxun/stf_run huggingface dataset:
A = input(a)
B = input(b)
K == (A+B)/2
if type(K) is int:       
    print(K)
else:
    print("Impossible")

### FIXED CODE ###

A,B = map(int,input().split())
K = (A+B)
if K%2 == 0 :
  print(K//2)
else:
  print("IMPOSSIBLE")
def mult(m):
  s = 1
  for x in m:
    s = s*x
    if s == 0:
      return 0
    if s > 10**18:
      return -1
   return s
n = int(input())
a = list(map(int,input.split()))
a.sort()
z = mult(a)
print(z)


### FIXED CODE ###

def mul(m) : 
      
    # Multiply elements one by one 
    res = 1
    for x in m: 
        res = res * x
        if res == 0:
             return 0 
        if res > 10**18:
             return -1
    return res
 
n = int(input())
a = list(map(int, input().split()))
a.sort()
z = mul(a)
print(z)
n,m=(int(i) for i  in input().split())
#print(n,m)
mtrx=[[int(i)-1 for i in input().split()] for j in range(m)]
#print(mtrx)
adjacent=[[i] for i in range(n)]
#print(adjacent)
for i in range(n):
    adjacent[mtrx[i][0]]+=[mtrx[i][1]]
    adjacent[mtrx[i][1]]+=[mtrx[i][0]]
#print(adjacent)

cnt=[]
def dfs(goal,path):
    p=path[-1]
    if p==goal:
        cnt.append(len(path))
        return
    else:
        for x in adjacent[p]:
            if x in path:
                continue
            else:
                path.append(x)
                dfs(goal,path)
                path.pop()

for i in range(1,n):
    dfs(i,[0])                

print(cnt.count(n))

### FIXED CODE ###

n,m=(int(i) for i in input().split())
mtrx=[[int(i) for i in input().split()] for j in range(m)]
#print(mtrx)
mtrx+=[[mtrx[i][1],mtrx[i][0]] for i in range(m)]
#print(mtrx)
mylist=[10*mtrx[i][0]+mtrx[i][1] for i in range(len(mtrx))]
#print(mylist)
# 順列を格納するリスト
perm = []
cnt=[]
# 順列の生成
def make_perm(n, m = 0):
    if n == m and perm[0]==1:
        flag=1
        for i in range(len(perm)-1):
            myval=10*perm[i]+perm[i+1]
            myval1=mylist.count(myval)
            flag=flag*myval1
        cnt.append(flag)
        
    else:
        for x in range(1, n + 1):
            if x in perm: continue
            perm.append(x)
            make_perm(n, m + 1)
            perm.pop()
            
make_perm(n)
print(sum(cnt))
N, M = list(map(int, input().split()))
sigma = list(map(int, input().split()))
gokans = []

for i in range(M):
    pair = list(map(int, input().split()))
    gokans.append(pair)

def connected(i, j, paths, chains):
    old_chain = []
    if i == 1:
        for pair in chains:
            paths.remove(pair)
    narabi = [couple[0] for couple in chains] + [couple[1] for couple in chains]
    if j in narabi:
        return True

    while chains != old_chain:
        old_chain = chains
        for pair in chains:
            new_chain = [couple for couple in paths if set(couple) & set(pair) != set()]
            chains += new_chain
            for pair in new_chain:
                paths.remove(pair)
        narabi = [couple[0] for couple in chains] + [couple[1] for couple in chains]
        if j in narabi:
            return True
    return False

count = 0
chain = []
for i in range(1, N+1):
    if i != sigma[i-1]:
        gokans1 = gokans.copy()
        chain += [pair for pair in gokans if i in pair]
        if ([pair for pair in gokans if i in pair] != []) and [pair for pair in paths if sigma[i-1] in pair] and connected(i, sigma[i-1], gokans1, chain):
            count += 1
    else:
        count += 1

print(count)

### FIXED CODE ###

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

par = [i for i in range(n)]
#rootの計算量は、parが最初の状態に近いほど値は小さくて、高々O(n)
def root(x):
	tmp = par[x]
	if tmp == x:
		return x
	else:
		a = root(tmp)
		par[x] = a
		return a

def merge(x, y):
	x = root(x)
	y = root(y)
	if x != y:
		par[x] = y
		return

for i in range(m):
	x, y = map(int, input().split())
	merge(x-1, y-1)
	#print(par)

ans = 0

for i in range(n):
	if p[i]-1 == i:
		ans += 1
	elif root(p[i]-1) == root(i):
		ans += 1
print(ans)
n = input()
import numpy as np
a = list(range(1,n+1))
b = list(range(1,n+1))
c = [0] * n
for i in range(n):
  while a[i] % 2 ==0:
    a[i] /= 2
    c[i] += 1
print(b[np.argmax(c)])




### FIXED CODE ###

n = int(input())
import numpy as np
a = list(range(1,n+1))
b = list(range(1,n+1))
c = [0] * n
for i in range(n):
  while a[i] % 2 == 0:
    a[i] /= 2
    c[i] += 1
print(b[np.argmax(c)])
A, B = map(int,input().split)
ans = A + B
if ans % 2 == 0:
  print(ans //2)
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

a,b=map(int, input().split())
ans = a + b
if ans % 2 == 0:
  print(ans //2)
else:
  print("IMPOSSIBLE")
tmp = raw_input()
s = map(int, list(set(raw_input().split())).sort())
tmp = raw_input()
t = map(int, raw_input().split().sort())

ans = 0

for i in t:
	i = 0
	while i <= s[i]:
		if i == s[i]: ans+= 1
		i += 1
print ans

### FIXED CODE ###

input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))
f

### FIXED CODE ###

a,b,x=map(int,input().split());print("YNEOS"[x-a not in range(b+1)::2])
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=int(input())
b=0
for i in range(1,n+1):
  if i==a:
    b+=1
    if b<m:a=int(input())
  else:
    dp[i]=dp[i-1]
    if i>1:dp[i]+=dp[i-2]
  dp[i]%=(10**9+7)
print(dp[-1])

### FIXED CODE ###

n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=b=0
if b<m:a=int(input())
for i in range(1,n+1):
  if i==a:
    b+=1
    if b<m:a=int(input())
  else:
    dp[i]=dp[i-1]
    if i>1:dp[i]+=dp[i-2]
  dp[i]%=(10**9+7)
print(dp[-1])
from math import gcd

N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

Ans = T[0]
for i in range(1,N):
    Ans = Ans*T[i]//gcd(Ans,T[i])

print(Ans)

### FIXED CODE ###

from fractions import gcd

N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

Ans = T[0]
for i in range(1,N):
    Ans = Ans*T[i]//gcd(Ans,T[i])

print(Ans)
import math
N = int(input())
ll = []

for i in range(N):
    l = list(input())
    l.sort()
    s = ''.join(l)
    ll.append(s)
ll.sort()
k = 0
ans = 0
for j in range(N-1):
    if ll[j]==ll[j+1]:
        k += 1
    elif k>0:
        ans += math.factorial(k+1)/math.factorial(2)/math.factorial(k+1-2)
        k = 0
if k>0:
    ans += math.factorial(k+1)/math.factorial(2)/math.factorial(k+1-2)
print(int(ans))

### FIXED CODE ###

import math
from operator import mul
from functools import reduce
N = int(input())
ll = []
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(N):
    l = list(input())
    l.sort()
    s = ''.join(l)
    ll.append(s)
ll.sort()
k = 0
ans = 0
for j in range(N-1):
    if ll[j]==ll[j+1]:
        k += 1
    elif k>0:
        ans += cmb(k+1, 2)
        k = 0
if k>0:
    ans += cmb(k+1, 2)
print(int(ans))
N = int(input().strip())
A = map(int, input().strip().split())


if N % 2 == 1:
  if A.count(0) != 1:
    print(0)
  else:
    if not all([A.count(i) == 2 for i in range(2, N, 2)]):
      print(0)
    else:
      print(2 ** ((N - 1) // 2) % (10**9 + 7))
else:
  if not all([A.count(i) == 2 for i in range(1, N, 2)]):
    print(0)
  else:
    print(2 ** ((N // 2) % (10**9 + 7)))

### FIXED CODE ###

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

if N % 2 == 0:
  for i in range(0, N, 2):
    if A[i] != A[i+1]:
      print(0)
      break
  else:
    print(2**(N // 2) % 1000000007)
else:
  if A[0] != 0:
    print(0)
  else:
    for i in range(1, N, 2):
      if A[i] != A[i+1]:
        print(0)
        break
    else:
      print(2**((N-1)//2) % 1000000007)
N=int(raw_input())

n=[0]*(10**9+1)

for i in range(N):
    a=int(raw_input())
    n[a]^=1

print n.count(1)


### FIXED CODE ###

N=int(raw_input())

num={}
for i in range(N):
    a=int(raw_input())
    if a in num:
        num[a]^=1
    else:
        num[a]=1

c=0
for k in num:
    if num[k]==1:
        c+=1
print c
import math, sys
N = int(input())
x = math.floor(N/1.08)
c = [x-1, x, x+1]
C = c*1.08
for i, j in zip(c, C):
    if j == N:
        print(i)
        sys.exit()
print(":(")

### FIXED CODE ###

N = int(input())
import math, sys
x = math.floor(N/1.08)
c = [x-1, x, x+1]
C = [i*1.08 for i in c]
for i, j in zip(c, C):
    if math.floor(j) == N:
        print(int(i))
        sys.exit()
print(":(")
import math
n = int(input())
lr = [None]*10000
rmax = 0
for i in range(n):
    lr[i]= list(map(int,input().split()))
    if lr[i][1] > rmax:
        rmax = lr[i][1]

p = [1]*(rmax+1)
p[0]=0
p[1]=0
        

for j in range(2,int(math.sqrt(rmax)+1)):
    if p[j] == 0:
        continue
    for i in range(2,rmax+1):
        if i!=j and i%j == 0:
            p[i] = 0
for i in range(rmax, 1,-2):
    if p[(i+1)//2] == 0 and p[i] == 1:
        p[i] = 0
p[2] = 0
for i in range(2,rmax):
    p[i+1] += p[i]  

for i in range(n):
    print(p[lr[i][1]] - p[lr[i][0]-1])

### FIXED CODE ###

import math
n = int(input())
lr = [None]*100000
rmax = 0
for i in range(n):
    lr[i]= list(map(int,input().split()))
    if lr[i][1] > rmax:
        rmax = lr[i][1]

p = [1]*(rmax+1)
p[0]=0
p[1]=0
        

for j in range(2,int(math.sqrt(rmax)+1)):
    if p[j] == 0:
        continue
    for i in range(2,rmax+1):
        if i!=j and i%j == 0:
            p[i] = 0
for i in range(rmax, 1,-2):
    if p[int((i+1)/2)] == 0:
        p[i] = 0
p[2] = 0
for i in range(2,rmax):
    p[i+1] += p[i]  

for i in range(n):
    print(p[lr[i][1]] - p[lr[i][0]-1])
def main():
A, B = map(int, input().split())
 print(A-2*B) if A > 2*B else print("0")
  
mail()

### FIXED CODE ###

def main():
 A, B = map(int, input().split())
 print(A-2*B) if A > 2*B else print(0)
  
main()
R,G,B=input().split(" ")
r=R
g=G
b=B
if (100*r+10*g+b)%4==0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

R,G,B=input().split(" ")
r=int(R)
g=int(G)
b=int(B)
s=100*r+10*g+b
if s%4==0:
    print("YES")
else:
    print("NO")
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)



### FIXED CODE ###



a,b,c,d=[int(i) for i in input().strip().split(' ')]

'''
入力は他の人のを見た
'''

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = [""] * (L + 10)
for i in range(N):
    idx = i * (L // N)
    x[idx] = S[i]
for i in range(M):
    idx = i * (L // M)
    if x[idx] != "" and x[idx] != T[i]:
        print(-1)
        exit()
print(L)


### FIXED CODE ###

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = {}
for i in range(N):
    idx = i * (L // N)
    x[idx] = S[i]
for i in range(M):
    idx = i * (L // M)
    if idx in x and x[idx] != T[i]:
        print(-1)
        exit()
print(L)
import sys
for i, x in enumerate(map(int, sys.stdin())):
  if x == 0 or not x:
    break;
  print('Case {0}: {1}'.format(i + 1, x))

### FIXED CODE ###

import sys
for i, x in enumerate(map(int, sys.stdin)):
  if x == 0 or not x:
    break;
  print('Case {0}: {1}'.format(i + 1, x))
n=int(input())
print("Yes" if n[1]==n[2] and (n[0]==n[1] or n[3]==n[1])  else "No")

### FIXED CODE ###

n=input()
print("Yes" if n[1]==n[2] and (n[0]==n[1] or n[3]==n[1])  else "No")
N = int(input())
S = list(input())
Q = int(input())

D = {chr(ord('a') + i): [] for i in range(26)}
for i, s in enumerate(S):
    D[s].append(i)

for q in range(Q):
    query = list(input().split())
    if query[0] == '1':
        i, x = int(query[1]), query[2]
        i -= 1
        s = S[i]
        if s == x:
            continue

        D[s].remove(i)
        next_i = bisect_left(D[x], i)
        D[x].insert(next_i, i)
        S[i] = x

    if query[0] == '2':
        l, r = int(query[1]), int(query[2])
        l, r = l - 1, r - 1
        ans = 0
        for i in range(26):
            s = chr(ord('a') + i)

            li = bisect_left(D[s], l)
            ri = bisect_right(D[s], r)

            if ri - li > 0:
                ans += 1

        print(ans)

### FIXED CODE ###

from bisect import bisect_left, bisect_right

N = int(input())
S = list(input())
Q = int(input())

D = {chr(ord('a') + i): [] for i in range(26)}
for i, s in enumerate(S):
    D[s].append(i)

for q in range(Q):
    query = list(input().split())
    if query[0] == '1':
        i, x = int(query[1]), query[2]
        i -= 1
        s = S[i]
        if s == x:
            continue

        D[s].remove(i)
        next_i = bisect_left(D[x], i)
        D[x].insert(next_i, i)
        S[i] = x

    if query[0] == '2':
        l, r = int(query[1]), int(query[2])
        l, r = l - 1, r - 1
        ans = 0
        for i in range(26):
            s = chr(ord('a') + i)

            li = bisect_left(D[s], l)
            ri = bisect_right(D[s], r)

            if ri - li > 0:
                ans += 1

        print(ans)
N,M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print(No)

### FIXED CODE ###

N,M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print("No")
N = int(input())
x = list(input())[::-1]
num = 0
nump = 0
numm = 0
pop_num = 0
for i in range(N):
    if x[i] == "1":
        pop_num += 1
for i in range(N):
    if x[i] == "1":
        num += pow(2,i,pop_num)
        num %= pop_num 
        nump += pow(2,i,pop_num+1)
        nump %= pop_num  + 1
        numm += pow(2,i,pop_num - 1)
        numm %= pop_num - 1



def popcnt(n):
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
    return c

x = x[::-1]
def calc(i,depth,n):
    if depth == 0:
        if x[i] == "1":
            tmp = numm
            tmp -= pow(2,N-i-1,pop_num-1)
            tmp %= (pop_num - 1)
            return calc(i,depth+1,tmp)
        else:
            tmp = nump
            tmp += pow(2,N-i-1,pop_num+1)
            tmp %= (pop_num + 1)
            return calc(i,depth+1,tmp)
    else:
        if n == 0: return depth
        return calc(i,depth+1, n % popcnt(n))
        

for i in range(N):
    print(calc(i,0,0))



### FIXED CODE ###

N = int(input())
x = list(input())[::-1]
num = 0
nump = 0
numm = 0
pop_num = 0
for i in range(N):
        if x[i] == "1":
            pop_num += 1
for i in range(N):
    if x[i] == "1":
        num += pow(2,i,pop_num)
        num %= pop_num 
        nump += pow(2,i,pop_num+1)
        nump %= pop_num  + 1
        if pop_num-1 != 0:
            numm += pow(2,i,pop_num - 1)
            numm %= pop_num - 1



def popcnt(n):
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
    return c

x = x[::-1]
def calc(i,depth,n):
    if depth == 0:
        if x[i] == "1":
            tmp = numm
            if pop_num - 1 != 0:
                tmp -= pow(2,N-i-1,pop_num-1)
                tmp %= (pop_num - 1)
            else:
                return 0
            return calc(i,depth+1,tmp)
        else:
            tmp = nump
            tmp += pow(2,N-i-1,pop_num+1)
            tmp %= (pop_num + 1)
            return calc(i,depth+1,tmp)
    else:
        if n == 0: return depth
        return calc(i,depth+1, n % popcnt(n))
        

for i in range(N):
    print(calc(i,0,0))
n,k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)] 

abb = ab.sort()

temp =0

for i in range(n):
    if temp < k:
        temp += abb[i][1]
    else:
        print(abb[i-1][0])
        exit()

### FIXED CODE ###

n,k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

abb = sorted(ab)
temp =0

for i in range(n+1):
    if temp < k:
        temp += abb[i][1]
    else:
        print(abb[i-1][0])
        exit()
a,b=input().split()
b = b[:-1]

if a ==b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a=input()
b=input()
b = b[:-1]

if a ==b:
    print('Yes')
else:
    print('No')
import math

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

def check(L):
    return sum(math.ceil(a / L)-1 for a in A) <= K

answer=max(A)
lo = 1
hi = answer+1
while lo < hi:
    m = (lo + hi)//2
    ok = check(m)
    if ok: 
        answer=min(m, answer)
        hi=m
    else:
        lo=m+1
print(answer))


"""
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x: lo = mid+1
        else: hi = mid
    return lo

    while lo < hi:
        mid = (lo+hi)//2
        if x < a[mid]: hi = mid
        else: lo = mid+1
    return lo
"""


### FIXED CODE ###

import math

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

def check(L):
    return sum(math.ceil(a / L)-1 for a in A) <= K

answer=max(A)
lo = 1
hi = answer+1
while lo < hi:
    m = (lo + hi)//2
    ok = check(m)
    if ok: 
        answer=min(m, answer)
        hi=m
    else:
        lo=m+1
print(answer)
a,b=map(int,input().split())
if a!=b:
  print("D")
else:
  print("H")

### FIXED CODE ###

a,b=map(str,input().split())
if a!=b:
  print("D")
else:
  print("H")
ygfgfuh

### FIXED CODE ###

A,B=map(int,input().split())
if 1<=A<=9:
        if 1<=B<=9:
            print(A*B)
        else:
            print(-1)
else: print(-1)
N,Q=map(int,input().split())
graph=[[] for _ in range(N+1)]
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

values=[0]*(N+1)
for _ in range(Q):
    p,x=map(int,input().split())
    values[p]+=x
def dfs(v,parent,add):
    values[v]+=add
    for x in graph[v]:
        if x==parent:
            continue
        dfs(x,v,values[v])
        
dfs(1,0,0)
answer=' '.join(map(str,values[1:]))
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)
ok=True
i=0
a,b,c,d=map(int,input().split())
k=c//b
c-=bk
a-=d(k)
if(a<=0 and c!=0):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

ok=True
i=0
a,b,c,d=map(int,input().split())
k=c//b
c-=b*k
a-=d*(k)
if(a<=0 and c!=0):
    print("No")
else:
    print("Yes")
H, W = map(int, input().split())
flag = False
for i in range(H):
    for j in range(W):
        s = input()
        if s == "snuke":
            print(chr(ord('A')+j)+str(i+1))
            flag = True
            break

    if flag:
        break


### FIXED CODE ###

H, W = map(int, input().split())
flag = False
for i in range(H):
    S = list(input().split())
    for j, s in enumerate(S):
        if s == "snuke":
            print(chr(ord('A')+j)+str(i+1))
            flag = True
            break

    if flag:
        break
import sys
sys.setrecursionlimit(2147483647)


n=int(input())

mod=10**9+7

#初期値が0の辞書
from collections import defaultdict
pp = defaultdict(lambda: 0) 
pm = defaultdict(lambda: 0) 

from fractions import gcd

for _ in range(n):
    a,b=map(int,input().split())
    tmp=gcd(a,b)
    a=a//tmp
    b=b//tmp

    if a*b>0:
        pp[(a,b)]+=1
    else:
        pm[(a,b)]+=1
            
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = mod #割る数
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

#print(pp_k,pm_k)
result=1
for key in pp.keys():
    pp_v=pp[key]
    a,b=key[0],key[1]
    pm_v=pm[(-1*b,a)]+pm[(b,-1*a)]
    result=result*((2**pp_v-1)+(2**pm_v-1)+1)

for key in pm.keys():
    pm_v=pm[key]
    a,b=key[0],key[1]
    pp_v=pp[(-1*b,a)]+pp[(b,-1*a)]

    if pp_v==0:
        result=result*(2**pm_v)

print(result-1)


    

    

### FIXED CODE ###

n=int(input())

mod=10**9+7

#初期値が0の辞書
from collections import defaultdict
pp = defaultdict(lambda: 0) 
pm = defaultdict(lambda: 0) 

def seiki(x,y):
    tmp=gcd(x,y)
    return (x//tmp,y//tmp)

from math import gcd
zero=0
for _ in range(n):
    a,b=map(int,input().split())

    if a==0 and b==0:
        zero+=1
    elif a*b>0:
        tmp=seiki(abs(a),abs(b))
        pp[tmp]+=1
    elif a==0:
        pp[(1,0)]+=1
    elif b==0:
        pm[(1,0)]+=1
        pp[(1,0)]+=0
    else:
        tmp=seiki(abs(b),abs(a))
        pm[tmp]+=1
        pp[tmp]+=0
#print(pm)
#print(pp)
result=1
for key in pp.keys():
    pp_v=pp[key]
    pm_v=pm[key]
    result*=(pow(2,pm_v,mod)+pow(2,pp_v,mod)-1)
    result%=mod

print((result-1+zero)%mod)
a, b, c = input()
if a == b:
    if a == c:
        print('No')
    else:
        print('Yes')
else:
    if a == c:
        print('Yes')
    else:
        if b == c:
            print('Yes')
        else:
            print('No')

### FIXED CODE ###

a, b, c = map(int,input().split())
if a == b:
    if a == c:
        print('No')
    else:
        print('Yes')
else:
    if a == c:
        print('Yes')
    else:
        if b == c:
            print('Yes')
        else:
            print('No')
n,m,x = map(int,input().split())
A = list(map(int,input().split()))

ans1 = len([a for a in A if a < x])
ans2 = len([a for a in A if a > x])
print(min(ans1,ans2))

### FIXED CODE ###

A,B,X = map(int,input().split())
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')
from math import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())

ans = n*m//gcd(n, m)
sp_a, sp_b = ans//n, ans//m
l = [False]*ans
jud = True
for i in range(n):
    l[i*sp_a] = s[i]

for i in range(m):
    if not l[i*sp_b]:
        l[i*sp_b] = t[i]
    else:
        if l[i*sp_b] != t[i]:
            jud = False
            break
if jud:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

from math import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())
g = gcd(n, m)
ans = n*m//g
sp_a, sp_b = m//g, n//g
jud = True
for i in range(ans//sp_a):
    if i*sp_a % sp_b == 0:
        if s[i % n] != t[i*sp_a//sp_b]:
            jud = False

if jud:
    print(ans)
else:
    print(-1)
a,b=map(int, raw_input().split())
d=a/b
e=a%b
print ('%d %d %f' % (d,e,float(a)/float(b))

### FIXED CODE ###

a,b=map(int, raw_input().split())
c=a/b
d=a%b
e=float(a)/float(b)
print ('%d %d %f' % (c,d,e))
import itertools

n, m, q = [int(x) for x in input().split()]
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

t = list(itertools.combinations_with_replacement(range(1, m + 1), m))

score = 0
for _t in t:
    _s = 0
    _t = list(_t)
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)

### FIXED CODE ###

import itertools

n, m, q = [int(x) for x in input().split()]
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

t = list(itertools.combinations_with_replacement(range(1, m + 1), n))

score = 0
for _t in t:
    _s = 0
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)