mod = 1000000007
import collections
n = int(input())
dat1 = []
dat2 = []
for i in range(n):
    a,b = map(int, input().split())
    dat1.append(a)
    dat2.append(b)
ngfish = []
for i in range(n):
    res = 0
    for j in range(i+1, n):
        if dat1[i] * dat1[j] + dat2[i] * dat2[j] == 0:
            res += 1
    ngfish.append(res)

#print(ngfish)

res = 0
for i in range(len(ngfish)):
    res += pow(2, n - i - 1 - ngfish[i], mod)
    res %= mod
print(res)

