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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.List;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author prakharjain
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        _1078C solver = new _1078C();
        solver.solve(1, in, out);
        out.close();
    }

    static class _1078C {
        List[] g;
        long[][] dp;
        int mod = 998244353;
        long[] pow;
        long[] sat;
        long[] single;
        long[] unsat;
        long satOneMul;
        long sat2OneMul;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            if (n <= 2) {
                out.print(n);
                return;
            }

            g = new List[n];

            in.readUndirectedGraph(g, n, n - 1, 1);
            //_2inv = pow(2, mod - 2, mod);

            dp = new long[n][3];
            //size = new int[n];

            pow = new long[n + 1];

            pow[0] = 1;

            for (int i = 1; i <= n; i++) {
                pow[i] = (2 * pow[i - 1]) % mod;
            }

            sat = new long[n];
            unsat = new long[n];
            single = new long[n];

            dfs(0, -1);

            long ans = dp[0][0] + dp[0][2];
            ans %= mod;
            if (ans < 0)
                ans += mod;
            out.print(ans);
        }

        void dfs(int u, int p) {
            if (g[u].size() == 1 && u != 0) {
                dp[u][0] = 1;
                dp[u][1] = 0;
                dp[u][2] = 0;
                return;
            }

            int ind = 0;

            int cn = g[u].size() - 1;

            if (u == 0) {
                cn++;
            }

            for (int v : (List<Integer>) g[u]) {
                if (v != p) {
                    dfs(v, u);
                }
            }

            satOneMul = 1;
            sat2OneMul = 1;

            for (int v : (List<Integer>) g[u]) {
                if (v != p) {
                    sat[ind] = dp[v][2];
                    single[ind] = dp[v][0];
                    unsat[ind] = dp[v][1];
                    satOneMul *= (sat[ind] + single[ind]);
                    satOneMul %= mod;
                    sat2OneMul *= (2 * sat[ind] + single[ind]);
                    sat2OneMul %= mod;
                    ind++;
                }
            }

            //2
            for (int i = 0; i < cn; i++) {
                dp[u][2] += (((unsat[i] + single[i]) * sat2OneMul) % mod) * pow((2 * sat[i] + single[i]) % mod, mod - 2, mod);
                dp[u][2] %= mod;
            }

            dp[u][0] = satOneMul;

            //1
            dp[u][1] = sat2OneMul - satOneMul;
            dp[u][1] %= mod;

//        long[][] cdp = new long[cn][4];
//
//        cdp[0][0] = zeroPre[0];
//        cdp[0][1] = oddPre[0];
//        cdp[0][2] = evenPre[0];
//
//        for (int i = 1; i < cn; i++) {
//            //0
//            cdp[i][0] = cdp[i - 1][0] * zeroPre[i];
//            //1
//            cdp[i][1] = cdp[i - 1][0] * oddPre[i] + cdp[i - 1][1] * zeroPre[i];
//            //2
//            cdp[i][2] = cdp[i - 1][0] * evenPre[i] + cdp[i - 1][2] * zeroPre[i];
//            //3
//            cdp[i][3] = cdp[i - 1][1] * evenPre[i] + cdp[i - 1][2] * oddPre[i] + cdp[i - 1][3] * zeroPre[i];
//
//            for (int j = 0; j < 4; j++) {
//                cdp[i][j] %= mod;
//            }
//        }
//
//        dp[u][0] = cdp[cn - 1][3] + cdp[cn - 1][2] + cdp[cn - 1][0];
//        dp[u][1] = cdp[cn - 1][2];
//        dp[u][2] = cdp[cn - 1][1] + cdp[cn - 1][0];
//
//        for (int j = 0; j < 3; j++) {
//            dp[u][j] %= mod;
//        }
//
//        //evenPre = in.calculatePrefixSum(evenPre, mod);
//
////        for (int j = 0; j < evenPre.length; j++) {
////            dp[u][0] += (evenPre[j] * tot) % mod;
////            dp[u][0] %= mod;
////        }
////
////        for (int j = 0; j < evenPre.length; j++) {
////            dp[u][0] -= (evenPre[j] * evenPre[j]) % mod;
////            dp[u][0] %= mod;
////        }
////
////        dp[u][0] *= _2inv;
////        dp[u][0] %= mod;
////
////        long t0 = (cn * (cn - 1)) / 2;
////        t0 %= mod;
////
////        dp[u][0] += t0 * (1 + tot0);
////        dp[u][0] %= mod;
////
////        for (int j = 0; j < cn; j++) {
////            dp[u][0] -= ((cn - 1) * zeroPre[j]) % mod;
////            dp[u][0] %= mod;
////        }
////
////        for (int j = 0; j < cn; j++) {
////            dp[u][0] += (evenPre[j] + 1) + tot0 - zeroPre[j];
////            dp[u][1] += (evenPre[j]) + tot0 - zeroPre[j];
////            dp[u][0] %= mod;
////            dp[u][1] %= mod;
////        }
////
////        for (int j = 0; j < cn; j++) {
////            if (sz[j] > 1) {
////                dp[u][2] += (oddPre[j]) + tot0 - zeroPre[j];
////                dp[u][2] %= mod;
////            }
////        }
////
////        dp[u][0] += tot0;
////        dp[u][2] += tot0;
////
////        dp[u][0] %= mod;
////        dp[u][2] %= mod;
        }

        long pow(long a, long p, int mod) {
            if (p == 0) {
                return 1;
            }

            long t = pow(a, p / 2, mod);

            if (p % 2 != 0) {
                return (((t * t) % mod) * a) % mod;
            } else {
                return (t * t) % mod;
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(long i) {
            writer.print(i);
        }

        public void print(int i) {
            writer.print(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public void readUndirectedGraph(List[] g, int numOfVertices, int numOfEdges, int offset) {
            for (int i = 0; i < numOfVertices; i++) {
                g[i] = new ArrayList();
            }

            for (int i = 0; i < numOfEdges; i++) {
                int u = nextInt() - offset;
                int v = nextInt() - offset;

                g[u].add(v);
                g[v].add(u);
            }
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

