Do you know the Pythagorean theorem? Definitely yes. Do you know Pythagorean triples? Maybe not. Do you know primitive Pythagorean pairs? Definitely not, because Bruce has not defined it yet! Let's start from Pythagorean triples. A **Pythagorean triple** consists of three positive integers , , and , such that . If and are also coprime, the pair is named a **primitive Pythagorean pair**, like . Bruce will tell you how to generate primitive Pythagorean pairs. Given two positive integers and , if and are coprime and is odd, a primitive Pythagorean pair can be calculated by and . There are an infinite number of primitive Pythagorean pairs.

Now Bruce has cards, each of which has a positive integer . He wants to pick up a number of cards so that there are no primitive Pythagorean pairs among the selected cards. Could you please help Bruce to get the total number of different selections? Two selections are different if and only if one card is in one selection, but is not in the other selection. Bruce has to select **at least one card** in each selection.

#### Input Specification

The first line of input will consist of one integer, , the number of cards Bruce has.

The second line of input will consist of positive integers , where is the value of card .

In of the test cases, .

In of the test cases, .

In of the test cases, .

In of the test cases, .

#### Output Specification

Output one integer, the number of different selections modulo .

#### Sample Input

```
4
5 12 35 5
```

#### Sample Output

`8`

#### Explanation of Output for Sample Input

There are two primitive Pythagorean pairs and . So, there are different selections: .

## Comments

will dmoj conjoin the subtasks together?

Are the tests sorted as is given in the Input specification section? I mean the first 3 tests have v_i <= 3000, second 3 have v_i <= 200000 and so on?

what's vi for 100% case

Its split into 3 parts:

In 30% of the test cases, 1≤vi≤3000.

In 30% of the test cases, 1≤vi≤200000.

In 40% of the test cases, 20000≤vi≤1000000.

+1, this is correct.