#include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> n; rep(i,n) { cin >> c >> d; ull e; e = ( (c+1)/2 ); e %= 1000000007; d %= 1000000007; ans += d*e; ans %= 1000000007; } printf("%llu\n",ans); return 0; }