#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, k;
  cin >> n >> k;
  vector<long long> arr(n);
  for (auto &x : arr) {
    cin >> x;
  }
  vector<long long> kek(n + 1);
  for (long long i = 0; i < n; i++) {
    kek[arr[i]] = i;
  }
  vector<long long> lol;
  long long sm = 0;
  for (long long i = n; i > n - k; i--) {
    sm += i;
    lol.push_back(kek[i]);
  }
  sort(lol.begin(), lol.end());
  long long res = 1;
  long long mod = 998244353;
  for (long long i = 1; i < lol.size(); i++) {
    res *= (lol[i] - lol[i - 1]);
    res %= mod;
  }
  cout << sm << " " << res << "\n";
}
