local mod = 1000000007LL local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function lltonumber(str) return C.atoll(str) end local a, b = io.read():match("(%d+) (%d+)") a = lltonumber(a) b = lltonumber(b) local ans = false if a == 0LL then ans = (b / 2LL) * 2LL + 1LL elseif b == 0LL then ans = (a / 2LL) * 2LL + 1LL elseif (a + b) % 2LL == 0LL then local x1 = (a - b) / 2LL local x2 = (-a - b) / 2LL local x3 = (a + b) / 2LL local width = x1 - x2 + 1LL local height = x3 - x1 + 1LL local p = ((width + mod - 1LL) % mod) * ((height + mod - 1LL) % mod) p = p % mod local q = (width % mod) * (height % mod) q = q % mod ans = (p + q) % mod else local l1 = a + 1LL local l2 = b + 1LL local rm = (a % mod) * (b % mod) + ((a + 1LL) % mod) * ((b + 1LL) % mod) rm = rm % mod local add = ((a * 2LL + 1LL) % mod) * ((b * 2LL + 1LL) % mod) ans = (add + mod - rm) % mod end ans = tostring(ans % mod):gsub("LL", "") print(ans)