#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
const int mod = 998244353;
int f[maxn][maxn], pre[maxn][maxn], n, k, a[maxn], ans;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) pre[i][1] = i;
  for (int v = 1; v * (k - 1) <= a[n]; v++) {
    int p = 1;
    for (int i = 2; i <= n; i++) {
      while (a[p] + v <= a[i]) p++;
      for (int j = 2; j <= min(i, k); j++) {
        f[i][j] = pre[p - 1][j - 1];
        pre[i][j] = (f[i][j] + pre[i - 1][j]) % mod;
      }
    }
    ans = (ans + pre[n][k]) % mod;
    if (ans == 0) break;
  }
  printf("%d\n", ans);
}
