HMT1 - How Many Trees 1

lqp18_31 count rooted unlabeled trees with N nodes one by one.

But the number is so large that he is afraid that he will never stop counting.

So he asks you to tell him the number of rooted unlabeled trees with N nodes modulo 10^9+7.

Input

One line containing one integer N. (1 <= N <= 1000)

Output

One line containing the number of rooted unlabeled trees with N nodes module 10^9+7.

Example

Input:
11

Output:
1842

Added by:刘启鹏
Date:2010-05-18
Time limit:0.100s
Source limit:3000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS OBJC PERL6 SQLITE VB.NET

hide comments
2010-06-29 11:55:45 Siddharth Kothari
It would be nice if you could add an explanation on "what an unlabeled rooted tree is?".

Last edit: 2010-05-21 11:51:21
2010-06-29 11:55:45 Oleg
Guess this should be moved to tutorial.
Classic already has http://www.spoj.pl/problems/PT07D/
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.