# Trees: Depth First Search

# Roads Improvement

The country has **n** cities and **n** - **1** bidirectional roads, it is possible to get from every city to any other one if you move only along the roads. The cities are numbered with integers from **1** to **n** inclusive.

All the roads are initially bad, but the government wants to improve the state of some roads. We will assume that the citizens are happy about road improvement if the path from the capital located in city **1** to any other city contains at most one bad road.

Determine the number of ways of improving the quality of some roads in order to meet the citizens' condition. As the answer can be large, print it modulo **1 000 000 007** (`10`

+ ^{9}**7**).

#### Input

The first line contains a single integer **n** (**2** ≤ **n** ≤ **2** * `10`

) — the number of cities in the country. Next line contains ^{5}**n** - **1** positive integers `p`

, _{2}`p`

, _{3}`p`

, ..., _{4}`p`

(_{n}**1** ≤ `p`

≤ _{i}**i** - **1**) — the description of the roads in the country. Number `p`

means that the country has a road connecting city pi and city _{i}**i**.

#### Output

Print the sought number of ways to improve the quality of the roads modulo **1 000 000 007** (`10`

+ ^{9}**7**).

3 1 1

4

6 1 2 2 1 5

15