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.
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:2000000")
#pragma comment(linker, "/HEAP:2000000")
using namespace std;
void print_width(long long x) {
  std::cout << std::fixed;
  std::cout << std::setprecision(x);
}
long long power(long long x, long long y, long long p = 1000000007) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void printArr(long long a[], long long n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << '\n';
}
void printVector(std::vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << '\n';
}
long long Min(long long a, long long b, long long c) {
  if (a < b and a < c) return a;
  if (b < c) return b;
  return c;
}
void initialize(long long arr[], long long n) {
  for (long long i = 0; i <= n; i++) arr[i] = i;
}
long long root(long long arr[], long long i) {
  while (arr[i] != i) {
    arr[i] = arr[arr[i]];
    i = arr[i];
  }
  return i;
}
void Union(long long arr[], long long a, long long b) {
  long long root_a = root(arr, a);
  long long root_b = root(arr, b);
  arr[root_a] = root_b;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long power_wm(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long double dpower(long double x, long long y) {
  long double res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
std::vector<long long> vsum(std::vector<long long> a) {
  std::vector<long long> s(a.size());
  s[0] = a[0];
  for (long long i = 1; i <= a.size() - 1; i++) {
    s[i] = s[i - 1] + a[i];
  }
  return s;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  long long x = a.second * b.first;
  long long y = a.first * b.second;
  if (x <= y)
    return false;
  else
    return true;
}
bool is_cap(char a) {
  if (a <= 'Z' and a >= 'A')
    return true;
  else
    return false;
}
bool is_small(char a) {
  if (a <= 'z' and a >= 'a')
    return true;
  else
    return false;
}
string findSum(string str1, string str2) {
  string str = "";
  if (str1.size() > str2.size()) {
    swap(str1, str2);
  }
  int n1 = str1.size(), n2 = str2.size();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry;
  carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum;
    sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum;
    sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
bool mcomp(long long a, long long b, long long c, long long d) {
  if (a == b and b == c and c == d)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  std::vector<std::vector<long long>> g(n + 1);
  std::vector<long long> deg(n + 1, 0);
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  queue<long long> q;
  std::vector<long long> level(n + 1, 0);
  std::vector<long long> vis(n + 1, 0);
  for (long long i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      q.push(i);
      vis[i] = 1;
    }
  }
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    for (long long i = 0; i < g[x].size(); i++) {
      long long y = g[x][i];
      if (vis[y] == 0) {
        vis[y] = 1;
        q.push(y);
        level[y] = level[x] + 1;
      }
    }
  }
  long long c = 0;
  long long de = -1;
  long long cen = -1;
  for (long long i = 1; i <= n; i++) {
    if (level[i] == k) {
      c++;
      de = deg[i];
      cen = i;
    }
  }
  long long flag = 0;
  for (long long i = 1; i <= n; i++) {
    if (deg[i] == 1 or deg[i] > 3 or i == cen) {
    } else {
      flag = 1;
    }
  }
  long long fl2 = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < g[i].size(); j++) {
      long long y = g[i][j];
      if (level[i] == level[y]) fl2 = 1;
    }
  }
  if (c == 1 and de >= 3 and flag == 0 and fl2 == 0) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
