def pandm(a,b):
    cnt = 0
    for i in range(len(a[0])):
        pp = a[0][i]
        ppb = b[0][i]
        for j in range(len(a[2])):
            pm = a[2][j]
            pmb = b[2][j]
            if pp*pm + ppb*pmb == 0:
                cnt += 1
        for j in range(len(a[3])):
            mp = a[3][j]
            mpb = b[3][j]
            if pp*mp + ppb*mpb == 0:
                cnt += 1
    for i in range(len(a[1])):
        mm = a[1][i]
        mmb = b[1][i]
        for j in range(len(a[2])):
            pm = a[2][j]
            pmb = b[2][j]
            if mm*pm + mmb*pmb == 0:
                cnt += 1
        for j in range(len(a[3])):
            mp = a[3][j]
            mpb = b[3][j]
            if mm*mp + mmb*mpb == 0:
                cnt += 1

    return cnt

from scipy.special import comb

def solve():
    n = int(input())
    a = [[],[],[],[]]
    b = [[],[],[],[]]
    for _ in range(n):
        A, B = map(int, input().split())
        if A>=0 and B>=0:
            a[0].append(A)
            b[0].append(B)
        elif A<0 and B<0:
            a[1].append(A)
            b[1].append(B) 
        elif A>=0 and B<0:
            a[2].append(A)
            b[2].append(B)
        elif A<0 and B>=0:
            a[3].append(A)
            b[3].append(B)

    cnt = pandm(a,b)
    ans = 0
    for i in range(1, n+1):
        ans += comb(n, i, exact=True)

    return ans%1000000007
    

print(solve())
