#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include int main() { long long N; int K; std::scanf("%lld%d", &N, &K); constexpr int limit = 40000000; if(N > limit) return 0; static unsigned F[limit], R[limit]; F[0] = F[1] = 1; for(int i = 2; i < N; ++i) { F[i] = (F[i - 1] + F[i - 2]) % 998244353; } for(int i = 0; i != N; ++i) R[i] = 1; while(K != 0) { if(K & 1) { for(int i = 0; i != N; ++i) { R[i] = (unsigned long long) R[i] * F[i] % 998244353; } } for(int i = 0; i != N; ++i) { F[i] = (unsigned long long) F[i] * F[i] % 998244353; } K >>= 1; } unsigned res = 0; for(int i = 0; i != N; ++i) res = (res + R[i]) % 998244353; printf("%u\n", res); }