#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> p1, pair<long long, long long> p2) {
  if (p1.first != p2.first) return p1.first < p2.first;
  return p1.second < p2.second;
}
long long givegcd(long long a, long long b) {
  if (b == 0) return a;
  return givegcd(b, a % b);
}
long long maxi(long long a, long long b) {
  if (a > b) return a;
  return b;
}
void doit() {
  long long m = 998244353;
  long long n, k;
  cin >> n >> k;
  long long ans = 0, pwn = INT_MIN;
  long long p[n];
  vector<pair<long long, long long> > v;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    ans += p[i];
    if (p[i] > pwn) pwn = p[i];
    v.push_back({p[i], i});
  }
  if (n == k)
    cout << ans << " "
         << "1\n";
  else if (k == 1) {
    cout << pwn << " 1\n";
  } else {
    sort(v.begin(), v.end());
    long long a[k];
    memset(a, 0, sizeof(a));
    long long temp = 0;
    int j = n - 1;
    for (int i = k - 1; i >= 0; i--) {
      a[i] = v[j].second;
      temp += v[j].first;
      j--;
    }
    ans = 1;
    sort(a, a + k);
    for (int i = 1; i < k; i++) ans = ((ans % m) * ((a[i] - a[i - 1]) % m)) % m;
    cout << temp << " " << ans << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) doit();
  return 0;
}
