import std; void main(){ auto inputs = readln.chomp.split(" ").to!(long[]); auto a = inputs[0]; auto b = inputs[1]; auto r = (a * 2 + 1) * b + a; if((a - b) % 2 == 0){ r += 1; } writeln(r % 1000000007); }