Roads Improvement
The country has cities and 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 to 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 improvements if the path from the capital, located in city , to any other city contains at most one bad road.
Determine the number of ways to improve the quality of some roads to meet the citizens' needs. As the answer can be large, print it modulo .
Input
The first line contains a single integer — the number of cities in the country. The next line contains positive integers — the description of the roads in the country. The number means that the country has a road connecting city and city .
Output
Print the number of ways to improve the quality of the roads modulo .