#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, k, a[1000 + 5], cur[1000 + 5];
long long dp[1000 + 5][1000 + 5], sum[1000 + 5][1000 + 5];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (k == 1) {
    long long sum = 0;
    for (int i = 1; i <= n; i++) sum += a[i];
    cout << sum << endl;
    return 0;
  }
  sort(a + 1, a + n + 1);
  a[0] = -1e6;
  long long ans = 0;
  for (int i = 1; i <= n; i++) cur[i] = i;
  for (int x = 1; x <= 100005 / (k - 1); x++) {
    for (int i = 1; i <= n; i++) {
      while (a[i] - a[cur[i]] < x) cur[i]--;
    }
    dp[0][0] = 1;
    for (int i = 0; i <= n; i++) sum[i][0] = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= min(k, i); j++) {
        dp[i][j] = sum[cur[i]][j - 1];
        sum[i][j] = (sum[i - 1][j] + dp[i][j]) % mod;
      }
    }
    for (int i = 1; i <= n; i++) ans = (ans + dp[i][k]) % mod;
  }
  cout << ans << endl;
  return 0;
}
