#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
const int mod = 998244353;
int n, K, a[N];
long long ans, f[N][N];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
long long calc(int x) {
  int pre = 0;
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    while (a[pre] <= a[i] - x) pre++;
    f[i][0] = 1;
    for (int j = 1; j <= K; j++)
      f[i][j] = (f[i - 1][j] + f[pre - 1][j - 1]) % mod;
  }
  return f[n][K];
}
int main() {
  n = read();
  K = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + n + 1);
  a[0] = -mod;
  for (int i = 1; (K - 1) * i <= a[n]; i++) ans = (ans + calc(i)) % mod;
  printf("%lld\n", ans);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
