Q=[1,2,5,22,75,264,941,3286,11623,40960,144267,508812,1792981,6319994,22277291] M=10**9+7 def mul(a,b) r=a.size.times.map{[0]*b[0].size} a.size.times{|y|b[0].size.times{|x|r[y][x]=b.size.times.reduce(0){|s,i|(s+a[y][i]*b[i][x])%M}}} r end k=gets.to_i k0 e=mul(e,a) if k%2>0 a=mul(a,a) k/=2 end p mul(e,[Q.reverse].transpose)[0][0]