#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, k, a[1003], r, dp[1003][1003], dpp[1003], fp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  dpp[0] = 1;
  for (int i = 1; i <= (a[n] - a[1]) / (k - 1); ++i) {
    r = 0;
    for (int j = 1; j <= k; ++j) dpp[j] = 0;
    for (int j = 1; j <= n; ++j) {
      while (a[j] - a[r + 1] >= i) {
        ++r;
        for (int ii = 1; ii <= k; ++ii) {
          (dpp[ii] += dp[r][ii]) %= mod;
        }
      }
      for (int ii = 1; ii <= k; ++ii) {
        dp[j][ii] = dpp[ii - 1];
      }
      (fp += dp[j][k]) %= mod;
    }
  }
  cout << fp << endl;
  return 0;
}
