Someone give a strange birthday present to Ivan. It is hedgehog — connected undirected graph in which one vertex has degree at least 3 (we will call it center) and all other vertices has degree 1. Ivan thought that hedgehog is too boring and decided to make himself k-multihedgehog.

Let us define k-multihedgehog as follows:

  * 1-multihedgehog is hedgehog: it has one vertex of degree at least 3 and some vertices of degree 1.
  * For all k ≥ 2, k-multihedgehog is (k-1)-multihedgehog in which the following changes has been made for each vertex v with degree 1: let u be its only neighbor; remove vertex v, create a new hedgehog with center at vertex w and connect vertices u and w with an edge. New hedgehogs can differ from each other and the initial gift. 



Thereby k-multihedgehog is a tree. Ivan made k-multihedgehog but he is not sure that he did not make any mistakes. That is why he asked you to check if his tree is indeed k-multihedgehog.

Input

First line of input contains 2 integers n, k (1 ≤ n ≤ 10^{5}, 1 ≤ k ≤ 10^{9}) — number of vertices and hedgehog parameter.

Next n-1 lines contains two integers u v (1 ≤ u,    v ≤ n;    u ≠ v) — indices of vertices connected by edge.

It is guaranteed that given graph is a tree.

Output

Print "Yes" (without quotes), if given graph is k-multihedgehog, and "No" (without quotes) otherwise.

Examples

Input

14 2
1 4
2 4
3 4
4 13
10 5
11 5
12 5
14 5
5 13
6 7
8 6
13 6
9 6


Output

Yes


Input

3 1
1 3
2 3


Output

No

Note

2-multihedgehog from the first example looks like this:

<image>

Its center is vertex 13. Hedgehogs created on last step are: [4 (center), 1, 2, 3], [6 (center), 7, 8, 9], [5 (center), 10, 11, 12, 13].

Tree from second example is not a hedgehog because degree of center should be at least 3.
import java.awt.List;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.TreeSet;



public final class CF_518_D1_B {

	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}


	static boolean dfsKO(int n,int k,int x,ArrayList<Integer>[] friends){
		log("starting with node:"+(x+1));
		int[] stack=new int[n];
		int[] anc=new int[n];
		
		int st=0;
		anc[x]=-1;
		stack[st++]=x;
		int[] h=new int[n];
		int max=0;
		int end=-1;
		while (st>0){
			int u=stack[--st];
			for (int v:friends[u]){
				if (v!=anc[u]){
					anc[v]=u;
					stack[st++]=v;
					h[v]=h[u]+1;
					if (h[v]>max)
						max=h[v];
					if (h[v]==2*k){
						end=v;
					}
					
				}
			}
		}
		
		
		log("end:"+(end+1));
		if (max!=2*k) {
			log("wrong max");
			return false;
		}
		int tgt=end;
		for (int i=0;i<k;i++)
			tgt=anc[tgt];
		log("tgt:"+(tgt+1));
		int[] dp=new int[n];
		st=0;
		stack[st++]=tgt;
		dp[tgt]=k;
		Arrays.fill(anc,-1);
		while (st>0){
			int u=stack[--st];
			int nb=friends[u].size();
			if (u!=tgt)
				nb--;
			if (dp[u]>0 && nb<3)
				return false;
			for (int v:friends[u]){
				if (v!=anc[u]){
					stack[st++]=v;
					dp[v]=dp[u]-1;
					anc[v]=u;
					if (dp[v]<0)
							return false;
				
				}
			}
		}
			return true;
	}
	static boolean dfs(int n,int k,int x,ArrayList<Integer>[] friends){
		log("starting with node:"+(x+1));
		int[] stack=new int[n];
		int[] anc=new int[n];
		
		int st=0;
		anc[x]=-1;
		stack[st++]=x;
		int[] h=new int[n];
		int max=0;
		int end=-1;
		while (st>0){
			int u=stack[--st];
			for (int v:friends[u]){
				if (v!=anc[u]){
					anc[v]=u;
					stack[st++]=v;
					h[v]=h[u]+1;
					if (h[v]>max)
						max=h[v];
					if (h[v]==2*k){
						end=v;
					}
					
				}
			}
		}
		
		st=0;
		h[end]=0;
		stack[st++]=end;
		Arrays.fill(anc,-1);
		max=0;
		while (st>0){
			int u=stack[--st];
			for (int v:friends[u]){
				if (v!=anc[u]){
					anc[v]=u;
					stack[st++]=v;
					h[v]=h[u]+1;
					if (h[v]>max)
						max=h[v];
					if (h[v]==2*k){
						end=v;
					}
					
				}
			}
		}
		
		log("end:"+(end+1));
		if (max!=2*k) {
			log("wrong max");
			return false;
		}
		
		
		
		int tgt=end;
		for (int i=0;i<k;i++)
			tgt=anc[tgt];
		log("tgt:"+(tgt+1));
		int[] dp=new int[n];
		st=0;
		stack[st++]=tgt;
		dp[tgt]=k;
		Arrays.fill(anc,-1);
		while (st>0){
			int u=stack[--st];
			int nb=friends[u].size();
			if (u!=tgt)
				nb--;
			//log("u:"+(u+1)+" nb:"+nb+" "+friends[u].size());
			if (dp[u]>0 && nb<3) {
				log("wrong depth "+(u+1));
				return false;
				
			}
			for (int v:friends[u]){
				if (v!=anc[u]){
					stack[st++]=v;
					dp[v]=dp[u]-1;
					anc[v]=u;
				
				}
			}
		}
			return true;
	}

	// Global vars
	static BufferedWriter out;
	static InputReader reader;


	static ArrayList<Integer>[] friends;
	
	static void process() throws Exception {


		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader=new InputReader(System.in);

		int n=reader.readInt();
		int k=reader.readInt();
		friends=new ArrayList[n];
		for (int i=0;i<n;i++)
			friends[i]=new ArrayList<Integer>();

		for (int i=1;i<n;i++){
			int u=reader.readInt()-1;
			int v=reader.readInt()-1;
			friends[u].add(v);
			friends[v].add(u);
		}

		boolean ok=false;
		for (int u=0;u<n;u++){
			if (friends[u].size()==1){
				ok=dfsKO(n,k,u,friends);
				
				break;
			}
		}
		if (ok)
			output("Yes");
		else
			output("No");

		try {
			out.close();
		}
		catch (Exception EX){}


	}


	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}


		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res=new StringBuilder();
			do {
				res.append((char)c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}




		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}


}