using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var a = NList; var ans = 1L; var mod = 998_244_353; for (var i = 0; i < 30; ++i) { var zero = 0; var one = 0; foreach (var ai in a) { if (((ai >> i) & 1) == 0) ++zero; else ++one; } if (zero > 0 && one > 0) ans = ans * 2 % mod; } WriteLine(ans); } }