{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eWe often say that details can reflect the level of one\u0027s EQ. For example, at BIT, when students study in classrooms (such as A105 in the General Teaching Building) or on long tables in the library, it is often embarrassing and uncomfortable (and occasionally smelly) if another student suddenly sits next to them, which we call low EQ behavior.\u003cbr\u003e\u003cbr\u003eNow, there is a long table containing $n$ seats, and the BIT students will choose their seats in the following way in order to avoid low EQ behavior as much as possible.\u003cbr\u003e- If the whole table is empty, randomly choose a position to sit.\u003cbr\u003e- Otherwise, choose a position whose shortest distance to other students is maximized. If there are more than one, randomly choose one of them with equal possibility.\u003cbr\u003e\u003cbr\u003eWhen the farthest distance is $1$ (i.e., he will sit next to a classmate anyway), students will sit at a different table to avoid low EQ behavior, and then we will call the table full.\u003cbr\u003e\u003cbr\u003eNow, Link wants to know the expected number of people seated in the table when the table is full.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of multiple test cases. \u003cbr\u003e\u003cbr\u003eThe first line contains an integer $T$ ($1 \\leq T \\leq 10^5$) -- the number of test cases.\u003cbr\u003e\u003cbr\u003eFor each testcase, there is only one integer $n$ ($1 \\leq n \\leq 10^6$) in a single line, which is the length of the table."}},{"title":"Output","value":{"format":"HTML","content":"For each testcase, output the answer modulo $10^9+7$.\u003cbr\u003e\u003cbr\u003eYou may find the way to modulo a rational number in Problem 1006.\u003cbr\u003e"}},{"title":"Sample","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\u003e5\r\n1\r\n2\r\n3\r\n4\r\n2021\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n1\r\n666666673\r\n2\r\n420089906\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}