#include using namespace std; using ll = long long int; using lc = complex; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll m, k; cin >> m >> k; vector> mat(m, vector(m)), ret(m, vector(m)); for(ll i=0; i> t = ret; ret.assign(m, vector(m)); // ret = ret * mat for(ll i=0; i> t = mat; mat.assign(m, vector(m)); for(ll i=0; i>= 1; } cout << ret[0][0] << endl; }