#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
const int mod = (1e9) + 7;
const double eps = 1e-10;
const int siz = 3e5 + 5, lg = 25, sq = 355, extrm[2] = {INT_MIN, INT_MAX};
const int modv = 998244353;
int n, dp[siz][3];
vector<int> adj[siz];
int mul(long long a, long long b) { return (a * b) % modv; }
int add(int a, int b) { return (a + b) % modv; }
int solve(int node, int p, int t) {
  if (dp[node][t] != -1) {
    return dp[node][t];
  }
  int sz = adj[node].size() - (p != 0);
  if (sz == 0) {
    return dp[node][t] = t != 1;
  }
  int *zeros = new int[sz], *zpo = new int[sz];
  bool sub = 0, pn0 = p != 0;
  for (int i = 0; i < sz + pn0; i++) {
    int ch = adj[node][i];
    if (ch == p) {
      sub = 1;
      continue;
    }
    int zero = solve(ch, node, 0), one = solve(ch, node, 1);
    zpo[i - sub] = add(zero, one);
    zeros[i - sub] = zero;
  }
  if (t == 2) {
    int res = 1;
    for (int i = 0; i < sz; i++) {
      res = mul(res, zpo[i]);
    }
    dp[node][t] = res;
  } else {
    int *pref = new int[sz], *suff = new int[sz], *twos = new int[sz];
    pref[0] = zpo[0];
    for (int i = 1; i < sz; i++) {
      pref[i] = mul(zpo[i], pref[i - 1]);
    }
    suff[sz - 1] = zpo[sz - 1];
    for (int i = sz - 2; i >= 0; i--) {
      suff[i] = mul(zpo[i], suff[i + 1]);
    }
    sub = 0;
    for (int i = 0; i < sz + pn0; i++) {
      int ch = adj[node][i];
      if (ch == p) {
        sub = 1;
        continue;
      }
      int two = solve(ch, node, 2);
      twos[i - sub] = two;
    }
    int res = 0;
    for (int i = 0; i < sz; i++) {
      res = add(res, mul(twos[i], mul(i != 0 ? pref[i - 1] : 1,
                                      i != sz - 1 ? suff[i + 1] : 1)));
    }
    if (t == 0) {
      int temp = 1;
      for (int i = 0; i < sz; i++) {
        temp = mul(temp, zeros[i]);
      }
      res = add(res, temp);
    }
    dp[node][t] = res;
    delete pref;
    delete suff;
    delete twos;
  }
  delete zeros;
  delete zpo;
  return dp[node][t];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  memset(dp, -1, sizeof dp);
  printf("%d\n", solve(1, 0, 0));
  return 0;
}
