#include const int Mod = 998244353; void merge_sort(int n, int x[]) { static int y[200001] = {}; if (n <= 1) return; merge_sort(n / 2, &(x[0])); merge_sort((n + 1) / 2, &(x[n/2])); int i, p, q; for (i = 0, p = 0, q = n / 2; i < n; i++) { if (p >= n / 2) y[i] = x[q++]; else if (q >= n) y[i] = x[p++]; else y[i] = (x[p] < x[q])? x[p++]: x[q++]; } for (i = 0; i < n; i++) x[i] = y[i]; } int main() { int i, N, A[200001]; scanf("%d", &N); for (i = 0; i < N; i++) scanf("%d", &(A[i])); merge_sort(N, A); int n = 0, B[200001]; for (i = 1, B[n++] = A[0]; i < N; i++) if (B[n-1] != A[i]) B[n++] = A[i]; int j, bit[31], flag[31] = {}; for (i = 1, bit[0] = 1; i <= 30; i++) bit[i] = bit[i-1] << 1; for (i = 0; i < n - 1; i++) { for (j = 30; j >= 0; j--) if ((B[i] & bit[j]) != (B[i+1] & bit[j])) break; flag[j] = 1; } int ans = 1; for (i = 0; i <= 30; i++) if (flag[i] != 0) ans <<= 1; printf("%d\n", ans % Mod); fflush(stdout); return 0; }