package main import ( "fmt" "math" ) func main() { var a, b, mod int fmt.Scan(&a, &b) mod = int(math.Pow(10, 9)) + 7 fmt.Println(resolve(a, b, mod)) } func resolve(a, b, mod int) int { if a%2 == b%2 { return (((a+1)%mod)*((b+1)%mod) + (a * b % mod)) % mod } else { return (((a+1)%mod)*(b%mod) + (a%mod)*((b+1)%mod)) % mod } }