#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using ull = unsigned long long; using Graph = vector>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define NP next_permutation const int INF32 = 2e9; const ll INF64 = 2e18; const ll mod = 998244353; // const ll mod = 1e9 + 7; template bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;} void cincout() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); } ll modPow(ll a, ll b, ll mod) { ll now = a; ll ret = 1; for (int i = 0; i < 63; i++) { if (b & (1LL << i)) ret = (ret * now) % mod; now = (now * now) % mod; } return ret; } using mint = modint998244353; int main() { cincout(); int N, K; cin >> N >> K; mint x = 1; mint y = 1; for (int i = 0; i < N; i++) { ll A; cin >> A; if (A >= K) x = x * K * modPow(A, mod - 2, mod); if (A >= K - 1) y = y * (K - 1) * modPow(A, mod - 2, mod); } mint ans = x - y; cout << ans.val() << endl; }