#include <bits/stdc++.h>
using namespace std;
const int N = 2048, Mod = 998244353;
long long a[N], dp[N][N], ans, n, k, res;
inline long long get(int x) {
  int po = 0;
  for (int i = 0; i <= n; i++) dp[i][0] = 1;
  for (int i = 1; i <= n; i++) {
    while (a[i] - a[po + 1] >= x) po++;
    for (int j = 1; j <= k; j++)
      dp[i][j] = (dp[i - 1][j] + dp[po][j - 1]) % Mod;
  }
  return dp[n][k];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; res = get(i); i++) ans = (ans + res) % Mod;
  cout << ans;
}
