#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> a;
  long long temp;
  for (long long i = 0; i < n; i++) {
    cin >> temp;
    if (temp >= n - k + 1) {
      a.push_back(i);
    }
  }
  long long sum = 1;
  for (long long i = 0; i < k - 1; i++) {
    sum = (sum * (a[i + 1] - a[i])) % (998244353);
  }
  cout << (k * (2 * n - k + 1)) / 2 << " ";
  cout << sum << endl;
  return 0;
}
