#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
template <class S, class T>
ostream &operator<<(ostream &os, pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long inf = 1000000001;
const long long INF = (long long)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
vector<int> dx2 = {1, 1, 0, -1, -1, -1, 0, 1},
            dy2 = {0, 1, 1, 1, 0, -1, -1, -1};
const long long MOD = 998244353;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  int n, k;
  cin >> n >> k;
  vector<long long> p(n);
  for (int i = 0; i < (n); i++) cin >> p[i];
  long long sum = 0;
  for (int i = 0; i < (k); i++) sum += n - i;
  cout << sum << " ";
  vector<long long> idx;
  for (int i = 0; i < (n); i++) {
    if (p[i] >= n + 1 - k) {
      idx.push_back(i);
    }
  }
  assert(idx.size() == k);
  long long ans = 1;
  for (int i = 0; i < ((int)idx.size() - 1); i++) {
    (ans *= idx[i + 1] - idx[i]) %= MOD;
  }
  cout << ans << endl;
}
