local mod = 998244353 local mfl = math.floor local function bmul(x, y) local x0, y0 = x % 31596, y % 31596 local x1, y1 = mfl(x / 31596), mfl(y / 31596) return (x1 * y1 * 62863 + (x1 * y0 + x0 * y1) * 31596 + x0 * y0) % mod end local function badd(x, y) return (x + y) % mod end local fact = {1} for i = 2, 200010 do fact[i] = bmul(fact[i - 1], i) end local n, a, b = io.read("*n", "*n", "*n") local tot = fact[n] local nota = fact[n - 1] if a == b then print((tot + mod * 2 - nota * 2) % mod) else if n == 2 then print(1) else local c = fact[n - 2] print((tot + mod * 4 - nota * 2 + c) % mod) end end