main=map read.words<$>getLine>>=print.(\x->mod(product x)1000000007).(\x->[fact (x!!0),fact (x!!1),if (mod((x!!0)-(x!!1))2)==0 then 2 else 1])
 where fact 0 = 1
       fact x = mod(x*(fact (x-1)))1000000007