#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  bool flg = false;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') flg = true;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return flg ? -x : x;
}
const int mod = 998244353;
inline int upd(const int &x) { return x + (x >> 31 & mod); }
inline void add(int &x, const int &y) { x = upd(x + y - mod); }
inline void iadd(int &x, const int &y) { x = upd(x - y); }
int qpow(int x, int y) {
  int res = 1;
  for (; y; y >>= 1, x = 1LL * x * x % mod)
    if (y & 1) res = 1LL * res * x % mod;
  return res;
}
int n;
pair<int, int> w[200010];
vector<int> e[200010];
vector<pair<int, int> > f[200010];
int g[200010];
inline int getsum(const vector<pair<int, int> > &f, int t) {
  int p = lower_bound((f).begin(), (f).end(), pair<int, int>(t, 0)) - f.begin();
  return f[p].second;
}
inline int getpos(const vector<pair<int, int> > &f, int t) {
  int p = lower_bound((f).begin(), (f).end(), pair<int, int>(t, 0)) - f.begin();
  return upd(f[p].second - (p ? f[p - 1].second : 0));
}
void dfs(int x, int fa) {
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y == fa) continue;
    dfs(y, x);
  }
  g[x] = 1;
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y == fa) continue;
    g[x] = 1LL * g[x] * getsum(f[y], o) % mod;
  }
  static int T[200010];
  int W = 1;
  for (int _(e[x].size() - 1), __(0); _ >= __; _--) {
    const int o = e[x][_];
    const int y = w[o].first ^ w[o].second ^ x;
    T[y] = W;
    if (y ^ fa) {
      W = 1LL * W *
          upd(g[y] + upd(f[y].back().second - getpos(f[y], o)) - mod) % mod;
    }
  }
  int S = 1;
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y != fa) {
      W = g[y];
      add(W, f[y].back().second);
      iadd(W, getsum(f[y], o));
      f[x].emplace_back(o, 1LL * S * W % mod * T[y] % mod);
      S = 1LL * S * getsum(f[y], o) % mod;
    } else {
      W = 1;
      f[x].emplace_back(o, 1LL * S * W % mod * T[y] % mod);
    }
  }
  for (int i(1), _i(f[x].size() - 1); i <= _i; i++)
    add(f[x][i].second, f[x][i - 1].second);
}
void solve() {
  n = read();
  for (int i(1), _i(n - 1); i <= _i; i++) {
    int u = read(), v = read();
    w[i] = pair<int, int>(u, v);
    e[u].push_back(i), e[v].push_back(i);
  }
  dfs(1, 0);
  int z = g[1];
  add(z, f[1].back().second);
  printf("%d\n", z);
}
int main() {
  for (int T = 1; T--;) solve();
  return 0;
}

### Prompt

Generate a Cpp solution to the following problem:

Vasya has a tree with n vertices numbered from 1 to n, and n - 1 edges numbered from 1 to n - 1. Initially each vertex contains a token with the number of the vertex written on it.

Vasya plays a game. He considers all edges of the tree by increasing of their indices. For every edge he acts as follows:

  * If both endpoints of the edge contain a token, remove a token from one of the endpoints and write down its number.
  * Otherwise, do nothing.



The result of the game is the sequence of numbers Vasya has written down. Note that there may be many possible resulting sequences depending on the choice of endpoints when tokens are removed.

Vasya has played for such a long time that he thinks he exhausted all possible resulting sequences he can obtain. He wants you to verify him by computing the number of distinct sequences modulo 998 244 353.

Input

The first line contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of vertices of the tree.

The next n - 1 lines describe edges of the tree. The i-th of these lines contains two integers u_i, v_i (1 ≤ u_i, v_i ≤ n) — endpoints of the edge with index i. It is guaranteed that the given graph is indeed a tree.

Output

Print a single integer — the number of distinct sequences modulo 998 244 353.

Examples

Input


5
1 2
1 3
1 4
1 5


Output


5


Input


7
7 2
7 6
1 2
7 5
4 7
3 5


Output


10

Note

In the first sample case the distinct sequences are (1), (2, 1), (2, 3, 1), (2, 3, 4, 1), (2, 3, 4, 5).

Int the second sample case the distinct sequences are (2, 6, 5, 3), (2, 6, 5, 7), (2, 6, 7, 2), (2, 6, 7, 5), (2, 7, 3), (2, 7, 5), (7, 1, 3), (7, 1, 5), (7, 2, 3), (7, 2, 5).

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  bool flg = false;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') flg = true;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return flg ? -x : x;
}
const int mod = 998244353;
inline int upd(const int &x) { return x + (x >> 31 & mod); }
inline void add(int &x, const int &y) { x = upd(x + y - mod); }
inline void iadd(int &x, const int &y) { x = upd(x - y); }
int qpow(int x, int y) {
  int res = 1;
  for (; y; y >>= 1, x = 1LL * x * x % mod)
    if (y & 1) res = 1LL * res * x % mod;
  return res;
}
int n;
pair<int, int> w[200010];
vector<int> e[200010];
vector<pair<int, int> > f[200010];
int g[200010];
inline int getsum(const vector<pair<int, int> > &f, int t) {
  int p = lower_bound((f).begin(), (f).end(), pair<int, int>(t, 0)) - f.begin();
  return f[p].second;
}
inline int getpos(const vector<pair<int, int> > &f, int t) {
  int p = lower_bound((f).begin(), (f).end(), pair<int, int>(t, 0)) - f.begin();
  return upd(f[p].second - (p ? f[p - 1].second : 0));
}
void dfs(int x, int fa) {
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y == fa) continue;
    dfs(y, x);
  }
  g[x] = 1;
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y == fa) continue;
    g[x] = 1LL * g[x] * getsum(f[y], o) % mod;
  }
  static int T[200010];
  int W = 1;
  for (int _(e[x].size() - 1), __(0); _ >= __; _--) {
    const int o = e[x][_];
    const int y = w[o].first ^ w[o].second ^ x;
    T[y] = W;
    if (y ^ fa) {
      W = 1LL * W *
          upd(g[y] + upd(f[y].back().second - getpos(f[y], o)) - mod) % mod;
    }
  }
  int S = 1;
  for (const int &o : e[x]) {
    const int y = w[o].first ^ w[o].second ^ x;
    if (y != fa) {
      W = g[y];
      add(W, f[y].back().second);
      iadd(W, getsum(f[y], o));
      f[x].emplace_back(o, 1LL * S * W % mod * T[y] % mod);
      S = 1LL * S * getsum(f[y], o) % mod;
    } else {
      W = 1;
      f[x].emplace_back(o, 1LL * S * W % mod * T[y] % mod);
    }
  }
  for (int i(1), _i(f[x].size() - 1); i <= _i; i++)
    add(f[x][i].second, f[x][i - 1].second);
}
void solve() {
  n = read();
  for (int i(1), _i(n - 1); i <= _i; i++) {
    int u = read(), v = read();
    w[i] = pair<int, int>(u, v);
    e[u].push_back(i), e[v].push_back(i);
  }
  dfs(1, 0);
  int z = g[1];
  add(z, f[1].back().second);
  printf("%d\n", z);
}
int main() {
  for (int T = 1; T--;) solve();
  return 0;
}

```