import strutils, sequtils, math proc trfm(x: int): int = x mod (10 ^ 9 + 7) let N = stdin.readLine.parseInt var C, D, cnt: int for i in 0 ..< N: (C, D) = stdin.readLine.split.map parseInt cnt += ((C + 1) div 2).trfm * D.trfm cnt = cnt.trfm echo cnt