Vasya has got a tree consisting of n vertices. He wants to delete some (possibly zero) edges in this tree such that the maximum matching in the resulting graph is unique. He asks you to calculate the number of ways to choose a set of edges to remove.

A matching in the graph is a subset of its edges such that there is no vertex incident to two (or more) edges from the subset. A maximum matching is a matching such that the number of edges in the subset is maximum possible among all matchings in this graph.

Since the answer may be large, output it modulo 998244353.

Input

The first line contains one integer n (1 ≤ n ≤ 3 ⋅ 10^5) — the number of vertices in the tree.

Each of the next n − 1 lines contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v) denoting an edge between vertex u and vertex v. It is guaranteed that these edges form a tree.

Output

Print one integer — the number of ways to delete some (possibly empty) subset of edges so that the maximum matching in the resulting graph is unique. Print the answer modulo 998244353.

Examples

Input

4
1 2
1 3
1 4


Output

4


Input

4
1 2
2 3
3 4


Output

6


Input

1


Output

1

Note

Possible ways to delete edges in the first example: 

  * delete (1, 2) and (1, 3). 
  * delete (1, 2) and (1, 4). 
  * delete (1, 3) and (1, 4). 
  * delete all edges. 



Possible ways to delete edges in the second example: 

  * delete no edges. 
  * delete (1, 2) and (2, 3). 
  * delete (1, 2) and (3, 4). 
  * delete (2, 3) and (3, 4). 
  * delete (2, 3). 
  * delete all edges. 
import java.io.*;
import java.util.*;

public class A implements Runnable {
	public static void main (String[] args) {new Thread(null, new A(), "_cf", 1 << 28).start();}

	int n;
	ArrayList<Integer>[] adj;
	int[][][] dp;
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");
		
		n = fs.nextInt();
		adj = new ArrayList[n];
		for(int i = 0; i < n; i++) adj[i] = new ArrayList<>();
		for(int i = 0; i < n-1; i++) {
			int u = fs.nextInt()-1;
			int v = fs.nextInt()-1;
			adj[u].add(v); adj[v].add(u);
		}
		
		dp = new int[2][2][n];
		for(int i = 0; i < 2; i++)
			for(int j = 0; j < 2; j++)
				Arrays.fill(dp[i][j], -1);
		ways1 = new int[n];
		ways2 = new int[n];
		int res = solve(0, 0, 1, -1);
		System.out.println(res);
		
		out.close();
	}
	
	int[] ways1, ways2;
	int solve(int node, int matched, int solo, int par) {
		int ret = dp[solo][matched][node];
		if(ret != -1) return ret;
		int allWays = 1, allWays2 = 1;
		
		int[] ways1 = new int[adj[node].size()];
		int[] ways2 = new int[adj[node].size()];
		boolean leaf = true;
		for(int i = 0; i < adj[node].size(); i++) {
			int v = adj[node].get(i);
			if(par == v) continue;
			leaf = false;
			int f1 = solve(v, 0, 0, node); //don't cut
			int f2 = solve(v, 0, 1, node); //do cut
			ways1[i] = f1; ways2[i] = f2;
			allWays = mult(allWays, add(ways1[i], ways2[i]));
			allWays2 = mult(allWays2, ways2[i]);
		}
		if(leaf) {
			int val = dp[solo][matched][node] = solo == 1 || matched == 1 ? 1 : 0;
			return val;
		}
		
		if(matched == 1) {
			return dp[solo][matched][node] = allWays;
		}
		else {
			int res = solo == 1 ? allWays2 : 0;
			for(int i = 0; i < adj[node].size(); i++) {
				int v = adj[node].get(i);
				if(v == par) continue;
				int left = div(allWays, add(ways1[i], ways2[i]));
				int get = solve(v, 1, 0, node);
				left = mult(left, get);
				res = add(res, left);
			}
			return dp[solo][matched][node] = res;
		}
	}
	
	int MOD = 998244353;
	int add(int a, int b) {
		a += b;
		if(a >= MOD) a -= MOD;
		return a;
	}
	int mult(long a, long b) {
		a *= b;
		if(a >= MOD) a %= MOD;
		return (int)a;
	}
	int div(int a, int b) {
		return mult(a, pow(b, MOD-2));
	}
	int pow(int base, int expo) {
		if(expo == 0) return 1;
		if(expo == 1) return base;
		if((expo&1) == 0) {
			int res = pow(base, expo>>1);
			return mult(res, res);
		}
		else {
			int res = pow(base, expo-1);
			return mult(res, base);
		}
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}