n = int(input())
l = 0
grid = [] 
for i in range(n):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
for i in range(n):
    for j in range(i+1,n):
        cal = grid[i][0]*grid[j][0] + grid[i][1]*grid[j][1]
        if cal == 0:
            l = l + 1
ans = (2**n)-1
if l == 0:
    print(ans)
else:
    for k in range(l):
        m = n - 2*l
        ans = ans - (2**m) - (2**m)* 2 * k
final = ans%1000000007
print(final)