Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th vertex gets color ci.

Now it's time for Timofey birthday, and his mother asked him to remove the tree. Timofey removes the tree in the following way: he takes some vertex in hands, while all the other vertices move down so that the tree becomes rooted at the chosen vertex. After that Timofey brings the tree to a trash can.

Timofey doesn't like it when many colors are mixing together. A subtree annoys him if there are vertices of different color in it. Timofey wants to find a vertex which he should take in hands so that there are no subtrees that annoy him. He doesn't consider the whole tree as a subtree since he can't see the color of the root vertex.

A subtree of some vertex is a subgraph containing that vertex and all its descendants.

Your task is to determine if there is a vertex, taking which in hands Timofey wouldn't be annoyed.

Input

The first line contains single integer n (2 ≤ n ≤ 105) — the number of vertices in the tree.

Each of the next n - 1 lines contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v), denoting there is an edge between vertices u and v. It is guaranteed that the given graph is a tree.

The next line contains n integers c1, c2, ..., cn (1 ≤ ci ≤ 105), denoting the colors of the vertices.

Output

Print "NO" in a single line, if Timofey can't take the tree in such a way that it doesn't annoy him.

Otherwise print "YES" in the first line. In the second line print the index of the vertex which Timofey should take in hands. If there are multiple answers, print any of them.

Examples

Input

4
1 2
2 3
3 4
1 2 1 1


Output

YES
2

Input

3
1 2
2 3
1 2 3


Output

YES
2

Input

4
1 2
2 3
3 4
1 2 1 2


Output

NO
    import java.util.*; 
                        import java.math.*;
                        import java.io.*;
                        import java.text.DecimalFormat;
                        import java.math.BigInteger;
                        public class Main{
                            //static int d=20;
                            static long mod=1000000007 ;
                            static HashMap<String,Double> hm=new HashMap<>(); 
                            static ArrayList<ArrayList<Integer>> arr;
                            static long[] dp1,dp2;
                            static int[] a;
                            static int[] vis,num;
                            static long max;
                            static HashSet<String> hs;
                            static int flag,ans,ans2;
                            public static void main(String[] args)  throws IOException {
                                boolean online =false;
                                String fileName = "C-large-practice";
                                PrintWriter out; 
                                if (online) {
                                    s.init(new FileInputStream(new File(fileName + ".in")));
                                     out= new PrintWriter(new FileWriter(fileName + "out.txt"));
                                }
                                 else {
                                    s.init(System.in);   
                                
                                    out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
                                }//r,b,y,g
                                int n=s.ni();
                                int[] a=new int[n];
                                arr=new ArrayList<>();
                                for(int i=0;i<n;i++)
                                    arr.add(new ArrayList<Integer>());
                                for(int i=0;i<n-1;i++){
                                    int x=s.ni()-1;
                                    int y=s.ni()-1;
                                    arr.get(x).add(y);
                                    arr.get(y).add(x);
                                }
                                for(int i=0;i<n;i++)
                                    a[i]=s.ni();
                                flag=0;
                                ans=1;
                                dfs2(0,-1,a);
                                //if(flag>1){
                                //    flag=0;
                                //  //  ans=2;
                                //    dfs2(1,-1,a);
                                //    
                                //}
                                if(flag>1)
                                    out.println("NO");
                                else{
                                    out.println("YES");
                                    out.println(ans);
                                }
                                out.close();
                 
                            }
                            
                            static class fam implements Comparable<fam> {
                                int age,pos,id;
                                public fam(int a,int b,int z){
                                    {   age=a;
                                        pos=b;
                                        id=z;
                                        
                                    }
                                    
                                    
                                    
                                }
                                public int compareTo(fam o){
                                    if(pos!=o.pos)
                                        return pos-o.pos;
                                    else
                                        return id-o.id;
                                }
                                
                            }
                           
                            public static void dfs2(int c,int p,int[] a){
                                //System.out.println(c+" "+p);
                                if(p>=0){
                                    if(a[p]!=a[c] && (flag==0 || ((ans-1)!=p)&& (ans2-1)!=p)){
                                        //System.out.println(c+" "+p);
                                        flag++;
                                        
                                        ans=c+1;
                                        ans2=p+1;
                                    }
                                    else if((a[p]!=a[c])&&(ans2-1)==p)
                                        ans=ans2;
                                    else if((a[p]!=a[c])&&(ans-1)==p)
                                        ans2=ans;
                                }
                                for(int x:arr.get(c)){
                                    if(x!=p)
                                        dfs2(x,c,a);
                                }
                                return;
                                
                                
                                
     
                            }
                            public static void dfs(int x,int[] vis,Stack<Integer> st){
                                vis[x]=1;
                                ArrayList<Integer> arr2=arr.get(x);
                                Collections.sort(arr2);
                                for(int i=arr2.size()-1;i>=0;i--){
                                    int z=arr2.get(i);
                                    if(vis[z]==0)
                                        dfs(z,vis,st);
                                }
                                st.push(x);
     
                            }
                            public static long gcd(long a, long b){
                                    if (a == 0) return b;
                                    return gcd(b % a, a);
                            }
                                
                            public static boolean check(long x){
                                if(x%4==0 || x%7==0 || x%11==0)
                                    return true;
                                if(x<4 || x<7 || x<11)
                                    return false;
                                if(x%2==0){
                                    return check(x/2);
                                }
                                else
                                    return check(x/2) && check((x+1)/2);
                            }
                            public static int angle(int x1,int x2,int x3,int y1,int y2,int y3){
                                long val=(y2-y1)*1L*(x3-x2)-(y3-y2)*1L*(x2-x1);
                                if(val<0)
                                    return 1;
                                else if(val>0)
                                    return -1;
                                else
                                    return 0;
                            }
                            
                            static class BIT{
                            
                                int N;
                                long tree[];
                                
                                BIT(int N){
                                    this.N = N;
                                    tree = new long[N + 1];
                                }
                                
                                void update(int idx,long val){
                                    while(idx <= N){
                                        tree[idx]+=val;
                                        idx += (idx & -idx);
                                    }
                                }
                                
                                long query(int l,int r){
                                    if(l == 1)
                                        return read(r);
                                    else
                                        return read(r) - read(l-1);
                                }
                                
                                long read(int idx){
                                    long sum = 0;
                                    while(idx > 0){
                                        sum += tree[idx];
                                        idx -= (idx & -idx);
                                    }
                                    return sum;
                                }
                            }
                            public static boolean pal(String a){
                                int i=0;
                                int j=a.length()-1;
                                while(i<j){
                                    if(a.charAt(i)!=a.charAt(j)){
                                        return false;
                                    }
                                    i++;
                                    j--;
                                }
                                return true;
                                    
                            }
                            public static long find(long n,long k){
                                if(n==2){
                                    if(k==1 || k==3)
                                        return 1;
                                    else
                                        return 2;
                                }
                                long t=pow2(2,n,mod)-1;
                                long z=(t+1)/2;
                                if(k==z)
                                    return n;
                                if(k<z)
                                    return find(n-1,k);
                                else
                                    return find(n-1,k-z);
                            }
                            public static long pow2(long a,long b,long mod){
                                    long ans=1;
                                    while(b>0){
                                        if(b%2==1)
                                            ans=(a*ans)%mod;
                                        a=(a*a)%mod;
                                        b/=2;
                                    }
                                    return  ans;
                            }
                            public static long pow3(long a,long b){
                                    long ans=1;
                                    while(b>0){
                                        if(b%2==1)
                                            ans=(a*ans);
                                        a=(a*a);
                                        b/=2;
                                    }
                                    return  ans;
                            }
                 
                             static class name implements Comparable<name> {
                                long l,b,h;
                                public name(long   x,long y,long z){
                                    {
                                        l=x;
                                        b=y;
                                    }
                                    
                                    
                                    h=z;
                                }
                                public int compareTo(name o){
                                    return -(int)(l*b-o.l*o.b);
                                }
                                
                            }
                            public static class s {
                                static BufferedReader reader;
                                static StringTokenizer tokenizer;
                            
                                /** call this method to initialize reader for InputStream */
                                static void init(InputStream input) {
                                    reader = new BufferedReader(
                                                new InputStreamReader(input) );
                                    tokenizer = new StringTokenizer("");
                                }   
                            
                                /** get next word */
                                static String ns() throws IOException {
                                    while ( ! tokenizer.hasMoreTokens() ) {
                                        //TODO add check for eof if necessary
                                        tokenizer = new StringTokenizer(
                                            reader.readLine() );
                                    }
                                    return tokenizer.nextToken();
                                }
                            
                                static int ni() throws IOException {
                                    return Integer.parseInt( ns() );
                                }
                            
                                static double nd() throws IOException {
                                    return Double.parseDouble( ns() );
                                }
                                static long nl() throws IOException {
                                    return Long.parseLong( ns() );
                                }
                            }
                        }
                                
