print((function (a, b, m) return tostring((a%m*b%m)%m):sub(1,-3) end)(io.stdin:read("*n"), io.stdin:read("*n"), 1000000007LL))