#include #include #define rep(i,n) for (int i = 0; i < int(n); ++i) #define repp(i,n,m) for (int i = m; i < int(n); ++i) using namespace std; using namespace atcoder; using mint = modint998244353; int main(){ int n, m; cin >> n >> m; vector l(m); rep(i,m) cin >> l[i]; vector dp(n+1,0); dp[0] = 1; repp(i,n+1,1){ rep(j,m) if (i - l[j] >= 0) dp[i] += (mint(n+2) * mint(l[j]) - mint(i)) * dp[i-l[j]]; dp[i] /= i; } mint ans = dp[n] / mint(n+1); cout << ans.val() << endl; }