An interesting game
72% Success1347 Attempts50 Points2s Time Limit256MB Memory1024 KB Max Code

Bob and James are about to play with an array \(A[]\) of \(N\) elements with Bob starting the game. In each turn :

  • A player selects a non-zero number of elements from \(A[]\) with the same value and removes them from \(A[]\).

The player whose turn makes array \(A[]\) becomes empty wins the game.

James is very intelligent and he modifies the game a bit. He selects some distinct elements (among those present in \(A\)) and removes all other elements which are not selected from \(A[]\). The game is then played using this modified array.

For example, consider \(A = [1,1,3,12,2,34,2] \). If James chooses values \((1,2,34)\), then the array with which the game is played is \([1,1,2,34,2]\).

Find the number of possible subsets of elements that James can select to modify \(A[]\) such that James is bound to win if both the players play optimally.

Consider an empty subset as a valid answer.

Since the number of possible subsets can be large enough, print the answer modulo \(10^9 + 7\).

Input format

  • The first line contains an integer \(T\) denoting the number of test cases.
  • The second line contains an integer \(N\).
  • The next line contains \(N\) space-separated integers, denoting elements of \(A[]\).

Output format

For each test case, print the number of possible subsets satisfying the criteria modulo \(10^9 + 7\) in a new line.

Constraints

\(1 \le T \le 10\)
\(1 \le N \le 2 \times 10^5\)
\(1 \le A[i] \le 10^{18}\)


Examples
Input
1
5
1 1 2 2 3
Output
2
Explanation

Two possible solutions are :-

  • Empty Subset
  • {1,2}

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading Editor...
Results