-- A Harmony

main :: IO()
main = do
  l <- getLine
  let a: b: _ = take 2 (map read (words l) :: [Int])
  let ans = solve a b
  if ans < 0
    then
    putStrLn("IMPOSSIBLE")
    else
    putStrLn(show ans)

solve :: Int -> Int -> Int
solve a b =
  if even diff
  then
    diff_div + smaller_one
  else
    -1
  where
    smaller_one = min a b
    diff = abs (a - b)
    diff_div = diff `div` 2

