Universal Cup Judging System

Universal Cup

Time Limit: 3.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

The Astana metro was built in an unusual way.

In the first year after the city was founded, one station was built in the city center, with number 1. In each following year $v$, the mayor chose one of the already passed years $p$, where $1 \le p < v$, and ordered a new station to be built with a track to the station that appeared in year $p$. Trains on this track can move only from the new station toward the center.

Thus, the metro always remained a tree, and from any station one can move only towards the central station, while from the central station there is nowhere to go. Stations that cannot be reached from other stations are called terminal.

Historically, the transfer complexity of station $v$ is defined as the number of stations from which one can get to $v$ by one track. However, the transfer complexity of a terminal station is equal to $1$.

It has been $n$ years since Astana was founded, so the metro already has $n$ stations.

This year, the mayor announced that in all following years, the station to which a new track will be attached will be chosen uniformly at random among all stations already built.

Pupa is planning a tourist visit to Astana in $m$ years, when there will already be $n + m$ stations. The mayor will build the new $m$ stations in this random way. According to the sightseeing plan, Pupa will make one metro ride: she will choose uniformly at random one terminal station, travel towards the center, and get off at the central station. Pupa will also buy a paper guidebook with all stations and their transfer complexities. She will cross out every station she visits (including both the first and the last station on the path) from her guidebook.

After the ride, Pupa plans to multiply the transfer complexities of all stations that were not crossed out from the guidebook — this number will be the result of her visit. If she crosses all the stations, result of her visit will be equal to $1$.

Help Pupa find the expected value of the result of her visit, modulo $998\,244\,353$.

Input

The first line contains two integers $n, m$ ($2 \le n \le 200$, $1 \le m \le 200$) — current number of stations in the metro, and the number of years after which Pupa will come to Astana.

The second line contains the integers $p_2, \ldots, p_n$ ($1 \le p_i < i$) — the tracks destinations for all stations from $2$ to $n$.

Output

Print a single number, the expected value of the result of Pupa visit after $m$ years. Print the answer modulo $998\,244\,353$.

Examples

Input 1

4 1
1 1 1

Output 1

1

Input 2

12 2
1 1 2 2 3 3 4 5 6 4 5

Output 2

413192725

Input 3

2 77
1

Output 3

253554867

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#2869EditorialOpenNew Editorial for Problem #20248louyuxuanView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.