n = int(input()) input() # ignore the numbers ans = 2 ** (n - 1) - 2 print(max(ans, 0) % 998244353)