The scientists at UniBuc have recently discovered an ancient game played by the Dacians called Bitscore. They would write on a piece of paper multiple strictly positive numbers and the players had to choose subsets with the property that the number of digits in the binary form of the numbers create a strictly decreasing sequence. For instance is a valid sequence, while is not valid.
Given an array of numbers compute the number of valid subsets. Because the result can be very big, print the result modulo .
The elements of a subset can be rearranged.
Input data
The first line contains a single number (). The second line contains numbers separated with spaces.
Output data
The only line contains the number of valid subsets.
Constraints and clarifications
- For points, it is guaranteed that ;
- For the last 65 points, we have .
Example 1
stdin
6
1 3 2 16 5 9
stdout
47
Example 2
stdin
6
1 6 3 4 5 2
stdout
23
Explanation
For the second example the subsets are: , , , , , , , , , , , , , , , , , , , , , ,