n=int(input())
a=[]
b=[]
for i in range(n):
    ai,bi=map(int,input().split())
    a.append(ai)
    b.append(bi)

c=[]
for i in range(n):
    for j in range(n):
        if a[i]*a[j]+b[i]*b[j]==0:
            ij=[i,j]
            c.append(ij)

s=0
for i in range(2**n):
    d=[]
    for j in range(n):
        if ((i>>j) & 1):
            d.append(j)
    t=0
    for j in range(len(c)):
        e=0
        if c[j][0] in d:
            e+=1
        if c[j][1] in d:
            e+=1
        if e==2:
            t+=1
    if t==0:
        s+=1

print((s-1)%1000000007)