题目描述 求 Dn:n 个元素的排列中没有任何元素回到原位的方案数,对 109+7 取模。已知 D1=0,Dn=(n−1)(Dn−1+Dn−2)。 输入格式 一行一个整数 n。 输出格式 一行一个整数,Dnmod(109+7)。 样例 输入 3 输出 2 数据范围 1≤n≤106