#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, f[1009], dp[1009][1009], lf, sm, pas, k,
    mod = 998244353;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> a >> k;
  for (c = 1; c <= a; c++) cin >> f[c];
  sort(f + 1, f + a + 1);
  for (d = 1; d <= f[a]; d++) {
    if (d * (k - 1) > f[a]) break;
    for (c = 1; c <= a; c++) {
      for (e = 1; e <= k; e++) {
        dp[c][e] = 0;
      }
    }
    for (e = 1; e <= k; e++) {
      lf = e - 1;
      sm = 0;
      for (c = e; c <= a; c++) {
        if (e == 1) {
          dp[c][e] = 1;
          continue;
        }
        while (lf < c && f[c] - f[lf] >= d) {
          sm += dp[lf][e - 1];
          sm %= mod;
          lf++;
        }
        dp[c][e] = sm;
        if (e == k) {
          pas += dp[c][k];
          pas %= mod;
        }
      }
    }
  }
  cout << pas;
  return 0;
}
