Degrees of vertices
On a lush green continent lived an unusual zebra named Hippo, who had a keen interest in mathematics and programming. One day, a programming competition was scheduled to take place on this continent, but it was discovered that the organizers were short on problems, systems, and jury members. Consequently, zebra Hippo was unexpectedly invited to join the jury for this olympiad.
Hippo was immediately assigned an important task: to verify the existence and uniqueness of the solution to one of the olympiad problems. Given a sequence (d) of length (N), the task is to determine whether there exists a tree with (N) vertices such that the (i)-th vertex is connected by edges to exactly (d_i) other vertices. If no such tree exists, the output should be "None". If the tree is unique up to isomorphism, the output should be "Unique". Otherwise, the output should be "Multiple".
Recall that trees (T_1) and (T_2) are considered isomorphic if there is a one-to-one correspondence (f) between the sets of vertices of (T_1) and (T_2) such that for every pair of vertices ((u, v)) in tree (T_1), an edge exists between vertices (u) and (v) in (T_1) if and only if there is an edge between vertices (f(u)) and (f(v)) in (T_2).
As duplication is a mandatory condition for preparing a quality olympiad, you are tasked with writing the same program.
Input
The first line of input contains an integer (N) ((2 N 100)). The second line of input contains (N) space-separated integers (d_1, ..., d_N) ((1 d_i N-1)).
Output
Based on the problem conditions, output one of the following lines: "None", "Unique", or "Multiple".