#include <bits/stdc++.h>
using namespace std;
int mod = 998244353;
const int maxn = 1005;
int dp[maxn][maxn];
int data[maxn];
int sum(int p1, int p2) { return (p1 + p2) % mod; }
int mult(int p1, int p2) { return 1LL * p1 * p2 % mod; }
int sub(int p1, int p2) { return (((long long int)p1 - p2) % mod + mod) % mod; }
long long int n, k;
void solve() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> data[i];
  sort(data + 1, data + n + 1);
  int maxd = (data[n] - data[1]) / (k - 1);
  int ans = 0;
  for (int d = 1; d <= maxd; d++) {
    for (int i = 1; i <= n; i++) {
      int idx =
          lower_bound(data + 1, data + n, max(0, data[i] - d + 1)) - data - 1;
      dp[i][1] = i;
      for (int j = 2; j <= k; j++) {
        dp[i][j] = sum(dp[i - 1][j], dp[idx][j - 1]);
      }
    }
    ans = sum(ans, dp[n][k]);
  }
  cout << ans << endl;
}
int main() { solve(); }
