#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> p(n), pos;
  pair<int, int> s[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    s[i].first = p[i];
    s[i].second = i;
  }
  sort(s, s + n);
  unsigned long long a1 = 0, a2 = 1, mul = 0;
  set<int> se;
  for (int i = n - 1; i >= n - k; i--) {
    a1 = (a1 + s[i].first);
    pos.push_back(s[i].second);
  }
  sort(pos.begin(), pos.end());
  for (int i = 1; i < pos.size(); i++) {
    a2 = (a2 * (pos[i] - pos[i - 1])) % 998244353;
    a2 = a2 % 998244353;
  }
  cout << a1 << " " << a2;
  return 0;
}
