[n], *e = [[*map(int, t.split())] for t in open(0)]
ans = 0
mod = 10 ** 9 + 7
slope_dict = {}
for x, y in e:
    a = 2**slope_dict.get(x/y, 0)
    b = 2**slope_dict.get(-y/x, 0)
    ans = ((ans * (2 * a + b - 1) + a)/(a + b - 1))  # % mod
    slope_dict[x/y] = slope_dict.get(x/y, 0) + 1

print(int(ans % mod))
