import copy
N=int(input())

abl=[]
for i in range(N):
    abl.append( list (map(int,input().split() )) )

sl=[]
for i in range(N):
    for j in range( i +1,N ):
        if abl[i][0] * abl[j][0]+ abl[i][1] * abl[j][1] == 0:
            sl.append([i+1,j+1])


l=[[]]
for i in range(1,N+1):
    tl= []
    for l2 in l:
        tl.append(copy.copy(l2))
        l2.append(i)
    l.extend(tl)

ct=0
ats= set()
for l2 in l:
    f=True
    for s in sl:
        if s[0] in l2 and s[1] in l2 :
            f=False
    if f:
        ats.add( tuple(l2) )
            
            



print(  (len(ats) -1) % 1000000007 )

        
       
   
     