#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<pair<long long int, long long int>> v(n);
  long long int b[n];
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v[i].first = x;
    v[i].second = i;
    b[i] = x;
  }
  long long int val = 0;
  sort(b, b + n, greater<long long int>());
  for (int i = 0; i < k; i++) val += b[i];
  sort(v.begin(), v.end());
  long long int per = 1;
  vector<long long int> ind;
  for (int i = n - 1; i >= n - k; i--) {
    ind.push_back(v[i].second);
  }
  long long int m = 998244353;
  sort(ind.begin(), ind.end());
  for (int i = 0; i < ind.size() - 1; i++) {
    per = (per * (abs(ind[i] - ind[i + 1]))) % m;
  }
  cout << val << " " << per << endl;
}
