#include <bits/stdc++.h>

typedef long long ll;
typedef long long ull;

using namespace std;

const int mxN = 3e5+5;
const int mxK = 26;
const int mod = 998244353;

struct node
{
    int id;
    bool e;
    int mp[mxK];
    node(int _id)
    {
        id = _id;
        e = false;
        for(int i = 0; i < mxK; i++) mp[i] = -1;
    }
};
vector<node> trie;
void add(int x, int i, string& s)
{
    if(i == (int)s.size())
    {
        trie[x].e = true;
        return;
    }
    int key = s[i]-'a';
    if(trie[x].mp[key] == -1)
    {
        trie[x].mp[key] = trie.size();
        trie.push_back({(int)trie.size()});
    }
    add(trie[x].mp[key], i+1, s);
}

map<pair<int, int>, int> _index;
map<int, bool> vis;

bool exist(int u, int v)
{
    if(u < v) swap(u, v);
    return _index.find({u, v}) != _index.end();
}
int create(int u, int v)
{
    if(u < v) swap(u, v);
    int sz = _index.size();
    return _index[{u, v}] = sz;
}
int key(int u, int v)
{
    if(u < v) swap(u, v);
    if(exist(u, v))
    {
        return _index[{u, v}];
    }
    else
    {
        return create(u, v);
    }
}

struct matrix
{
    int k;
    vector<vector<ll>> a;
    matrix(int kk)
    {
        k = kk;
        a = vector<vector<ll>>(k);
        for(int i = 0; i < k; i++)
        {
            a[i] = vector<ll>(k, 0);
        }
    }

    void print()
    {
        for(int j = 0; j < k; j++)
        {
            for(int i = 0; i < k; i++)
            {
                cout << a[j][i] << " ";
            }
            cout << "\n";
        }
    }
};

matrix mul(matrix a, matrix b)
{
    int k = a.k;
    matrix ret(k);
    for(int i = 0; i < k; i++)
    {
        for(int j = 0; j < k; j++)
        {
            for(int q = 0; q < k; q++)
            {
                ret.a[i][q] = (ret.a[i][q] + a.a[i][j] * b.a[j][q]) % mod;
            }
        }
    }
    return ret;
}

matrix powb(matrix mat, ll x)
{
    int k = mat.k;
    matrix ret(k);
    for(int i = 0; i < k; i++) ret.a[i][i] = 1;
    while(x)
    {
        if(x&1)
        {
            ret = mul(mat, ret);
        }
        mat = mul(mat, mat);
        x >>= 1;
    }
    return ret;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    trie.push_back({0});
    int n; ll m; cin >> n >> m;
    for(int i = 0; i < n; i++)
    {
        string s; cin >> s;
        add(0, 0, s);
    }
    queue<pair<int, int>> q;
    q.push({0, 0}); /// nalazim se na 0 0
    create(0, 0);
    while(!q.empty())
    {
        auto pos = q.front(); q.pop();
        int u = pos.first, v = pos.second;
        ///probaj svaku tranziciju
        for(int k = 0; k < mxK; k++)
        {
            if(trie[u].mp[k] == -1 || trie[v].mp[k] == -1) continue;///nema
            int up = trie[u].mp[k], vp = trie[v].mp[k];
            if(!exist(up, vp))
            {
                create(up, vp);
                q.push({up, vp});
            }
            if(trie[up].e && !exist(0, vp))
            {
                create(0, vp);
                q.push({0, vp});
            }
            if(trie[vp].e && !exist(up, 0))
            {
                create(up, 0);
                q.push({up, 0});
            }
        }
    }
    int k = _index.size(); ///create matrix [k x k]
    matrix mat(k);
    q.push({0, 0});
    vis[key(0, 0)] = 1;
    while(!q.empty())
    {
        auto pos = q.front(); q.pop();
        int u = pos.first, v = pos.second;
        int x = key(u, v);
        ///probaj svaku tranziciju
        for(int k = 0; k < mxK; k++)
        {
            if(trie[u].mp[k] == -1 || trie[v].mp[k] == -1) continue;///nema
            int up = trie[u].mp[k], vp = trie[v].mp[k];
            mat.a[x][key(up, vp)]++;
            if(!vis[key(up, vp)])
            {
                vis[key(up, vp)] = 1;
                q.push({up, vp});
            }
            if(trie[up].e)
            {
                mat.a[x][key(0, vp)]++;
                if(!vis[key(0, vp)])
                {
                    vis[key(0, vp)] = 1;
                    q.push({0, vp});
                }
            }
            if(trie[vp].e)
            {
                mat.a[x][key(up, 0)]++;
                if(!vis[key(up, 0)])
                {
                    vis[key(up, 0)] = 1;
                    q.push({up, 0});
                }
            }
            if(trie[up].e && trie[vp].e)
            {
                mat.a[x][0]++;
            }
        }
    }
    mat = powb(mat, m);
    cout << mat.a[0][0];
}

/*
8 10000000
abcde
bcdef
cdefg
defga
efgab
fgabc
gabcd
a
*/
