Problem: You are given a tree of n vertices. You are to select k (not necessarily distinct) simple paths in such a way that it is possible to split all edges of the tree into three sets: edges not contained in any path, edges that are a part of exactly one of these paths, and edges that are parts of all selected paths, and the latter set should be non-empty.

Compute the number of ways to select k paths modulo 998244353.

The paths are enumerated, in other words, two ways are considered distinct if there are such i (1 ≤ i ≤ k) and an edge that the i-th path contains the edge in one way and does not contain it in the other.

Input

The first line contains two integers n and k (1 ≤ n, k ≤ 10^{5}) — the number of vertices in the tree and the desired number of paths.

The next n - 1 lines describe edges of the tree. Each line contains two integers a and b (1 ≤ a, b ≤ n, a ≠ b) — the endpoints of an edge. It is guaranteed that the given edges form a tree.

Output

Print the number of ways to select k enumerated not necessarily distinct simple paths in such a way that for each edge either it is not contained in any path, or it is contained in exactly one path, or it is contained in all k paths, and the intersection of all paths is non-empty. 

As the answer can be large, print it modulo 998244353.

Examples

Input

3 2
1 2
2 3


Output

7


Input

5 1
4 1
2 3
4 5
2 1


Output

10


Input

29 29
1 2
1 3
1 4
1 5
5 6
5 7
5 8
8 9
8 10
8 11
11 12
11 13
11 14
14 15
14 16
14 17
17 18
17 19
17 20
20 21
20 22
20 23
23 24
23 25
23 26
26 27
26 28
26 29


Output

125580756

Note

In the first example the following ways are valid：

  * ((1,2), (1,2)), 
  * ((1,2), (1,3)), 
  * ((1,3), (1,2)), 
  * ((1,3), (1,3)), 
  * ((1,3), (2,3)), 
  * ((2,3), (1,3)), 
  * ((2,3), (2,3)). 



In the second example k=1, so all n ⋅ (n - 1) / 2 = 5 ⋅ 4 / 2 = 10 paths are valid.

In the third example, the answer is ≥ 998244353, so it was taken modulo 998244353, don't forget it!

Solution (in JAVA):

Solution:
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Test {

  static PrintWriter writer =
      new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
  final int pri = 3;
  int n, k;
  List<Integer>[] g;
  int N = 123456;
  int[] cnt = new int[N];
  int[] desc = new int[N];
  int[] km = new int[N];
  int[] iter = new int[N];
  int ITER = 1;
  int[] cb = new int[N];
  final int M = 998_244_353;
  int[] cc = new int[1 << 19], cx = new int[1 << 19];
  int ans = 0;
  int[] f = new int[1 << 19];

  static int readInt() {
    int ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static long readLong() {
    long ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static String readLine() {
    StringBuilder b = new StringBuilder();
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (Character.isLetterOrDigit(c)) {
          start = true;
          b.append((char) c);
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return b.toString();
  }

  public static void main(String[] args) {
    Test te = new Test();
    te.start();
    writer.flush();
  }

  int pmod(int b, int e) {
    int i = 1 << 31;
    int r = 1;
    while (i != 0) {
      r = mul(r, r);
      if ((e & i) != 0) r = mul(r, b);
      i >>>= 1;
    }
    return r;
  }

  void fft(int[] a, int off, int len) {
    for (int i = 0; i < len; i++) {
      int j = i, x = 0, y = len - 1;
      while (y > 0) {
        x = (x << 1) + (j & 1);
        j >>>= 1;
        y >>>= 1;
      }
      if (i < x) {
        int t = a[off + i];
        a[off + i] = a[off + x];
        a[off + x] = t;
      }
    }
    for (int i = 1; i < len; i *= 2) {
      int s = pmod(pri, (M - 1) / 2 / i);
      for (int j = 0; j < len; j += 2 * i) {
        int w = 1;
        for (int k = 0; k < i; k++) {
          int u = a[off + j + k], v = mul(a[off + j + k + i], w);
          a[off + j + k] = add(u, v);
          a[off + j + k + i] = add(u, M - v);
          w = mul(w, s);
        }
      }
    }
  }

  void ifft(int[] a, int off, int len) {
    int ll = 1, rr = len - 1;
    while (ll < rr) {
      int t = a[off + ll];
      a[off + (ll++)] = a[off + rr];
      a[off + (rr--)] = t;
    }
    fft(a, off, len);
    int inv = pmod(len, M - 2);
    for (int i = 0; i < len; i++) a[off + i] = mul(inv, a[off + i]);
  }

  void go(int p, int u) {
    desc[u] = 0;
    cnt[u] = 1;
    for (int v : g[u]) {
      if (v == p) continue;
      go(u, v);
      cnt[u] += cnt[v];
      desc[u] = add(desc[u], desc[v]);
    }
    int sz = 0;
    for (int v : g[u]) if (v != p) cx[sz++] = cnt[v];
    if (p != -1) cx[sz++] = (n - cnt[u]);
    comb(sz);
    ITER++;
    for (int v : g[u]) {
      if (v == p && p == -1) continue;
      int c = v == p ? n - cnt[u] : cnt[v];
      if (iter[c] != ITER) {
        iter[c] = ITER;
        cb[c] = inverse(c, sz);
      }
      if (v == p) desc[u] = add(desc[u], cb[c]);
      else ans = add(ans, mul(cb[c], desc[v]));
    }
    int sum = 0;
    for (int v : g[u]) if (v != p) sum = add(sum, desc[v]);
    for (int v : g[u]) {
      if (v == p) continue;
      sum = add(sum, M - desc[v]);
      ans = add(ans, mul(sum, desc[v]));
    }
  }

  int inverse(int d, int c) {
    int sum = 0;
    int pre = 0;
    for (int i = 0; i < c && i <= k - 1; i++) {
      int cur = add(f[i], M - mul(pre, d));
      sum = add(sum, mul(cur, km[i]));
      pre = cur;
    }
    return sum;
  }

  int add(int a, int b) {
    return (a+b) % M;
  }

  int mul(int a, int b) {
    return (int) ((a * (long) b) % M);
  }

  int cal(int p, int ll, int c) {
    if (c == 1) {
      f[ll] = cc[p];
      f[ll + 1] = cx[p];
      return 2;
    }
    int len = cal(p, ll, c / 2);
    int b = 1;
    while (b < c+1) b <<= 1;
    Arrays.fill(f, ll + len, ll + b, 0);
    len = cal(p + c/2, ll + b, c - c/2);
    Arrays.fill(f, ll + b + len, ll + b + b, 0);
    fft(f, ll, b);
    fft(f, ll + b, b);
    for (int i = ll; i < ll + b; i++) f[i] = mul(f[i], f[i + b]);
    ifft(f, ll, b);
    return b;
  }

  void comb(int c) {
    if (c == 0) return;
    cal(0, 0, c);
  }

  void start() {
    n = readInt();
    k = readInt();
    if (n == 1) {
      writer.println(0);
      return;
    }
    g = new List[n + 1];
    for (int i = 1; i <= n; i++) g[i] = new ArrayList<>();
    km[0] = 1;
    int v = k;
    for (int i = 1; i < n; i++) {
      km[i] = v;
      v = mul(v, k - i);
    }
    Arrays.fill(cc, 1);
    for (int i = 0; i < n - 1; i++) {
      int a = readInt(), b = readInt();
      g[a].add(b);
      g[b].add(a);
    }
    go(-1, 1);
    writer.println(ans);
  }
}