Petya was late for the lesson too. The teacher gave him an additional task. For some array *a* Petya should find the number of different ways to select non-empty subset of elements from it in such a way that their product is equal to a square of some integer.

Two ways are considered different if sets of indexes of elements chosen by these ways are different.

Since the answer can be very large, you should find the answer modulo 10<sup class="upper-index">9</sup> + 7.
First line contains one integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number of elements in the array.

Second line contains *n* integers *a*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 70) — the elements of the array.
In first sample product of elements chosen by any way is 1 and 1 = 1<sup class="upper-index">2</sup>. So the answer is 2<sup class="upper-index">4</sup> - 1 = 15.

In second sample there are six different ways to choose elements so that their product is 4, and only one way so that their product is 16. So the answer is 6 + 1 = 7.
4
1 1 1 1
15
4
2 2 2 2
7
5
1 2 4 5 8
7
1
64
1
5
2 2 2 2 2
15
6
1 2 3 4 5 6
7
2
70 70
1
7
4 9 16 25 36 49 64
127
13
64 65 40 26 36 46 53 31 63 11 2 46 59
15
15
66 34 43 45 61 14 12 67 38 25 55 9 30 41 16
15
17
44 57 54 57 54 65 40 57 59 16 39 51 32 51 20 9 8
511
18
22 41 40 8 36 48 23 5 58 12 26 44 53 49 3 56 58 57
127
20
20 34 51 40 70 64 14 30 24 20 6 1 70 28 38 43 9 60 31 69
2047
5
19 51 55 29 13
0
6
19 60 48 64 56 27
3
7
67 52 58 62 38 26 2
1
7
5 28 46 57 39 26 45
1
7
53 59 56 9 13 1 28
3
10
38 58 51 41 61 12 17 47 18 24
3
10
27 44 40 3 33 38 56 37 43 36
7
10
51 4 25 46 15 21 32 9 43 8
15
10
5 66 19 60 34 27 15 27 42 51
7
5
2 3 5 7 11
0
10
2 3 5 7 11 13 17 19 23 29
0
2
15 45
0
n = int(input())
a = list(map(int, input().split()))
mod = int(1e9)+7

dp = [[0]*(71) for _ in range(n+1)]
dp[0][1] = 1

for i in range(1, n+1):
    for j in range(1, 71):
        dp[i][j] = dp[i-1][j] + dp[i-1][j//a[i-1]] if j%a[i-1] == 0 else dp[i-1][j]
        dp[i][j] %= mod

ans = 0
for j in range(1, 71):
    if int(j**0.5)**2 == j:
        ans += dp[n][j]
        ans %= mod

print(ans-1)
