from functools import cmp_to_key n=int(input()) a=[] for i in range(n): x,y=map(int, input().split()) a.append([x,y]) def pos(v): if v[1]<0: return -1 if v[1]==0 and 0<=v[0]: return 0 return 1 def comp(s,t): if(pos(s)!=pos(t)): return -1 if pos(s)=0): r=r+1 ans=(ans+(r-l)*(x1*(y1+q[j][1])-y1*(x1+q[j][0]))) %1000000007 print(ans)