#include <bits/stdc++.h>
using namespace std;
int inline read() {
  int num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
const int maxn = 1010, mod = 998244353;
int n, k, a[maxn], f[maxn][maxn], s[maxn][maxn], ANS;
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + n + 1);
  a[0] = -2147483647;
  for (int ans = 1; ans <= a[n] / (k - 1); ans++) {
    f[0][0] = 1;
    s[0][0] = 1;
    int pl = 0, S = 0;
    for (int i = 1; i <= n; i++) {
      while (a[pl] <= a[i] - ans) pl++;
      for (int j = 0; j <= k; j++) {
        if (j) f[i][j] = s[pl - 1][j - 1];
        s[i][j] = (s[i - 1][j] + f[i][j]) % mod;
      }
      S = (S + f[i][k]) % mod;
    }
    ANS = (ANS + S) % mod;
  }
  cout << ANS;
  return 0;
}
