#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int n, k;
long long f[1005][1005], a[1005], res[100005], ans, s[1005][1005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + n + 1);
  a[0] = -2000000000;
  for (int v = 1; v * (k - 1) <= a[n]; v++) {
    int now = 0;
    f[0][0] = 1;
    s[0][0] = 1;
    for (int i = 1; i <= n; i++) {
      while (a[now] <= a[i] - v) {
        now++;
      }
      for (int j = 0; j <= k; j++) {
        if (j) f[i][j] = s[now - 1][j - 1];
        s[i][j] = (s[i - 1][j] + f[i][j]) % MOD;
      }
      res[v] += f[i][k];
      res[v] %= MOD;
    }
    ans += res[v] % MOD;
  }
  printf("%lld\n", ans % MOD);
}
