#include <bits/stdc++.h>
using namespace std;
long long ans, n, m, i, j, k, la, a[10010], f[1010][1010], g[1010][1010],
    p = 998244353;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  a[0] = -1e9;
  for (k = 1; k * (m - 1) <= a[n]; k++) {
    f[0][0] = g[0][0] = 1;
    la = 0;
    for (i = 1; i <= n; i++) {
      while (a[i] - a[la] >= k) la++;
      for (j = 0; j <= m; j++) {
        if (j) f[i][j] = g[la - 1][j - 1];
        g[i][j] = (g[i - 1][j] + f[i][j]) % p;
      }
      ans = (ans + f[i][m]) % p;
    }
  }
  printf("%lld", ans);
}
