#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, m, n, second, k, j;
  cin >> n >> k;
  long long p[n], a[k];
  j = 0;
  for (i = 0; i < n; i++) {
    cin >> p[i];
    if (p[i] > n - k) {
      a[j] = i;
      j++;
    }
  }
  sort(a, a + k);
  second = 1;
  for (i = 0; i < k - 1; i++) {
    second *= a[i + 1] - a[i];
    second = second % 998244353;
  }
  m = (2 * n - k + 1) * k;
  m /= 2;
  cout << m << " " << second;
  return 0;
}
