{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"Auntie Mars is going on a walk in the park. The park has the structure of a tree with \u003cvar\u003e\\(N\\)\u003c/var\u003e fields numbered \u003cvar\u003e\\(1, 2, \\ldots, N\\)\u003c/var\u003e, for each \u003cvar\u003e\\(i\\)\u003c/var\u003e (\u003cvar\u003e\\(1 \\leq i \\leq N - 1\\)\u003c/var\u003e), the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th bridge connects the field \u003cvar\u003e\\(x_i\\)\u003c/var\u003e and \u003cvar\u003e\\(y_i\\)\u003c/var\u003e.\n\n\u003cp\u003e\n\u003cp\u003e\nAuntie Mars wants to pluck some flowers from some fields. Auntie Mars isn\u0027t allowed to pluck flowers from \u003cvar\u003e\\(2\\)\u003c/var\u003e adjacent fields. Auntie Mars can pluck at most one flower from a field.\n\n\u003cp\u003e\n\u003cp\u003e\nFind the number of ways in which Auntie Mars can pluck flowers from the fields, modulo \u003cvar\u003e\\(10^9 + 7\\)\u003c/var\u003e.\n\n\u003cp\u003e\n\u003cp\u003e\n*Two ways are considered different if there is a field where Auntie Mars plucked a flower in the first way but not in the second."}},{"title":"Constraints","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cul\u003e\n \u003cli\u003eAll values in input are integers.\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(1 \\leq N \\leq 10^5\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(1 \\leq x_i, y_i \\leq N\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003eThe given graph is a tree.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/section\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\n \u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(x_1\\)\u003c/var\u003e \u003cvar\u003e\\(y_1\\)\u003c/var\u003e\n\u003cvar\u003e\\(x_2\\)\u003c/var\u003e \u003cvar\u003e\\(y_2\\)\u003c/var\u003e\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\n\u003cvar\u003e\\(x_{N - 1}\\)\u003c/var\u003e \u003cvar\u003e\\(y_{N - 1}\\)\u003c/var\u003e\n\u003c/pre\u003e\n\u003c/section\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Find the number of ways in which Auntie Mars can pluck flowers from the fields, modulo \u003cvar\u003e\\(10^9 + 7\\)\u003c/var\u003e."}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1 2\n2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eThere are five ways to pluck the flowers, as follows:\u003c/p\u003e\n \u003cp\u003e\u003cimg alt\u003d\"\" src\u003d\"CDN_BASE_URL/3473f4a4bc481813277bb76ffad69288?v\u003d1669128945\"\u003e\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 2\n1 3\n1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eThere are nine ways to pluck the flowers, as follows:\u003c/p\u003e\n \u003cp\u003e\u003cimg alt\u003d\"\" src\u003d\"CDN_BASE_URL/ce9fa23ce35fcdd550490cfa8417f785?v\u003d1669128945\"\u003e\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n\u003c/section\u003e"}},{"title":"Sample 4","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e10\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 2\n1 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e157\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n\u003c/section\u003e"}}]}