import math
import collections

n = int(input())
iwashi = [None for _ in range(n)]
for i in range(n):
    a, b = map(int, input().split())
    iwashi[i] = (math.degrees(math.atan2(a, b)) + 180) % 180
# print(iwashi)
iwashi = collections.Counter(iwashi)
k_list = list(iwashi.keys())
v = list(iwashi.values())
# k_list.sort(key=lambda x: -x)

mod = 1000000007
ans = 1
for k in k_list:
    a = iwashi[k]
    b = iwashi[k+90] + iwashi[k-90]
    if a*b != 0:
        ans *= (pow(2, a, mod) + pow(2, b, mod) -1)
    else:
        ans *= (a+1)
    iwashi[k] = 0
    iwashi[k+90] = 0
    iwashi[k-90] = 0
    # print(a, b, ans)
    ans %= mod
print(ans-1)
