Researchers in group theory and researchers in linear algebra want to combine their two theories. In group theory, permutations, also called bijective functions, matter a lot. For a finite set A, a function σ:A→A is a permutation of A if and only if there is a function ρ:A→A such that σ(ρ(a))=a and ρ(σ(a))=a hold for every a∈A.
The other half of the team, the linear algebra experts, work with idempotent functions a lot. They appear as projections when a 3D game computes shadows, and as closure operators such as the transitive closure. A function p:A→A is idempotent if and only if p(p(a))=p(a) holds for every a∈A.
The team wants to know how many permutations of a finite set A are not idempotent. They already found that this count depends only on the size of A. Given a size n, count the permutations of a set of n elements that are not idempotent.
The first line contains the number of test cases t (1≤t≤100). Each of the next t lines contains one set size n (1≤n≤105).
For each test case, print one line with the number of permutations of a set of n elements that are not idempotent, modulo 109+7=1000000007.