An interesting game
22% Success1644 Attempts50 Points1s Time Limit256MB Memory1024 KB Max Code

Bob and Alice are playing with an array \(A[]\) of \(n\) elements with Bob starting the game. In each turn:

  1. A player picks a non-zero number of elements from \(A[]\) with the same value and remove it from \(A[]\).
  2. The player whose turn makes array \(A[]\) empty wins the game.

Alice modifies the game a bit. She selects some distinct elements that are present in \(A[]\) and removes all other elements that are not selected from \(A[]\). Now, the game is played using this modified array. For example, if \(A = [1,1,3,12,2,34,2]\) and Alice selects 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 Alice can select to modify \(A[]\) such that Alice must win if both the players play optimally.

Note

  • Consider an empty subset as a valid answer.
  • Since the number of possible subsets can be large, print the answer modulo \(10^9 + 7\).

Input format

  • The first line contains \(N\).
  • The next line contains \(N\) space-separated integers denoting the elements of \(A[]\).

Output format

Print the number of possible subsets of elements that Alice can select to modify \(A[]\) such that Alice must win if both the players play optimally modulo \(10^9 + 7\).

Constraints
\(1 \le N \le 100000\\ 1 \le A[i] \le 100\)

Examples
Input
5
1 1 2 2 3
Output
2
Explanation

Two possible solutions are:

  1. Empty Subset
  2. {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