answer
First of all we need to know the nature of a number of times for that point in the tree degree at some point in the sequence appears -1 prufer
Emotional understanding of what, in fact, according to prufer sequence Seeking to push themselves what came out
Provided in the subject to a degree of $ D [] $
First of all d--
Then arranges the composition was out
This is a multi-set number of permutations
From the first n d [1] is the number of $ C_ {n} ^ {d [1]} $ then the remaining nd [1] select d [2] $ C_ {nd [1]} ^ {d [ 2]} and so $
$C_{n}^{d[1]}\times C_{n-d[1]}^{d[2]}\times C_{n-d[1]-d[2]}^{d[3]}\times ……\times C_{n-d[1]-……-d[n-1]}^{d[n]}$
get
$\frac{n!}{\sum\limits_{i=1}^{n}d[i]!}$
High-precision transfer would be finished
Or you had not?
Some special sentence:
The first problem will be the case no solution
Then when only one point of the program number 1
Then when there is a number of degrees scheme point 0 to a special treatment