#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, k, a[1005];
long long ans;
long long dp[1005][1005];
long long s[1005][1005];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int j = 1; j * (k - 1) <= a[n]; j++) {
    dp[0][0] = 1;
    s[0][0] = 1;
    int _index = 1;
    for (int i = 1; i <= n; i++) {
      while (a[_index] <= a[i] - j) _index++;
      for (int z = 0; z <= k; z++) {
        if (z) dp[i][z] = s[_index - 1][z - 1];
        s[i][z] = (s[i - 1][z] + dp[i][z]) % mod;
      }
      ans = (ans + dp[i][k]) % mod;
    }
  }
  cout << ans;
  return 0;
}
