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