from collections import Counter
import math
ans = 1
PI = math.pi
MOD = 1000000007
N = int(input())
theta_list = []
for i in range(N):
    x, y = map(int, input().split())
    # r = math.sqrt(x**2 + y**2)
    theta = math.atan(y/x)
    theta_list += [theta]
    ans = (ans * 2) % MOD
    # if theta == PI / 2:
    #     theta_list += [theta-PI/2]
    # elif theta >= 0:
    #     theta_list += [theta]
    # else:
    #     theta_list += [theta + PI/2]
ans = (ans - 1) % MOD
counter = Counter()
for theta in theta_list:
    counter[str(theta)[:13]] += 1
items = counter.items()
visited = {}
for key, count in items:
    theta = float(key)
    if key == 0:
        continue
    elif theta > 0:
        theta -= PI/2
    elif theta < 0:
        theta += PI/2

    trg_key = str(theta)[:13]
    if visited.get(trg_key):
        continue
    visited[key] = True
    visited[trg_key] = True
    # print(counter[str(theta)[:13]] * count)
    ans = (ans - counter[str(theta)[:13]] * count * (N-1)) % MOD

# print(counter)
# print(theta_list)
print(ans)