#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <set>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }

template<class T>
T pow(T x, ll n) {
    T r = 1;
    while (n) {
        if (n & 1) r *= x;
        x *= x;
        n >>= 1;
    }
    return r;
}

template<uint MD>
struct ModInt {
    uint v;
    ModInt() : v{0} {}
    ModInt(ll v) : v{normS(v%MD+MD)} {}
    static uint normS(const uint &x) {return (x<MD)?x:x-MD;};
    static ModInt make(const uint &x) {ModInt m; m.v = x; return m;}
    ModInt operator+(const ModInt &r) const {return make(normS(v+r.v));}
    ModInt operator-(const ModInt &r) const {return make(normS(v+MD-r.v));}
    ModInt operator*(const ModInt &r) const {return make((ull)v*r.v%MD);}
    ModInt& operator+=(const ModInt &r) {return *this=*this+r;}
    ModInt& operator-=(const ModInt &r) {return *this=*this-r;}
    ModInt& operator*=(const ModInt &r) {return *this=*this*r;}
    static ModInt inv(const ModInt &x) {
        return pow(ModInt(x), MD-2);
    }
};
using Mint = ModInt<998244353>;

const int MN = 200200;

template<class D>
struct Matrix {
    vector<vector<D>> d;
    int N, M;
    Matrix(int N, int M) : N(N), M(M) {
        d.resize(N);
        for (int i = 0; i < N; i++) {
            d[i] = vector<D>(M);
        }
    }

    vector<D>& operator[](int p) {return d[p];}
    const vector<D>& operator[](int p) const {return d[p];}

    const Matrix operator+(const Matrix &right) const {
        assert(right.N == N && right.M == M);
        Matrix res(N, M);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                res[i][j] = d[i][j]+right[i][j];
            }
        }
        return res;
    }

    const Matrix operator*(const Matrix &right) const {
        assert(M == right.N);
        Matrix res(N, right.M), r(right.M, right.N);
        for (int i = 0; i < right.M; i++) {
            for (int j = 0; j < right.N; j++) {
                r[i][j] = right[j][i]; 
            }
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < right.M; j++) {
                for (int k = 0; k < M; k++) {
                    res[i][j] += d[i][k]*r[j][k];
                }
            }
        }
        return res;
    }

    const Matrix operator*(const D &x) const {
        Matrix res(N, M);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                res[i][j] = d[i][j]*x;
            }
        }
        return res;
    }
};

template<class T>
Matrix<T> pow(Matrix<T> x, ll p) {
    assert(x.N == x.M);
    int N = x.N;
    Matrix<T> res(N, N), buf = x;
    for (int i = 0; i < N; i++) res[i][i] = T(1);
    while(p != 0) {
        if (p % 2) {
            res = res*buf;
        }
        p /= 2;
        buf = buf*buf;
    }
    return res;
}
using Mat = Matrix<Mint>;

Mint getFib(ll k) {
    Mat v(2, 1);
    v[0][0] = 0;
    v[1][0] = 1;
    Mat m(2, 2);
    m[0][0] = 0;
    m[0][1] = 1;
    m[1][0] = 1;
    m[1][1] = 1;
    v = pow(m, k)*v;
    return v[0][0];
}

int n; ll m;
Mint fib[MN];

int main() {
    ios::sync_with_stdio(0);
    int n; ll m;
    cin >> n >> m;
    Mint fa = 0, fb = 1;
    fib[0] = 0;
    for (int i = 1; i < n; i++) {
        Mint fc;
        fc = fa+fb; fa = fb; fb = fc;
        fc = fa+fb; fa = fb; fb = fc;
        fib[i] = fa;
    }

    Mint ans = 0;
    Mint base = 1;
    for (int i = 0; i < n; i++) {
        ans += fib[n-1-i] * base;
        base *= Mint::inv(i+1);        
        base *= Mint(m+i);
    }
    //cout << getFib(m + 2*(n-1)).v << " " << ans.v << endl;
    cout << (getFib(m + 2*(n-1)) - ans).v << endl;
    return 0;
}



Measured memory_bytes: 1152