#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
bool subsequence_checker(string str1, string str2, long long int m,
                         long long int n) {
  if (m == 0) return true;
  if (n == 0) return false;
  if (str1[m - 1] == str2[n - 1])
    return subsequence_checker(str1, str2, m - 1, n - 1);
  return subsequence_checker(str1, str2, m, n - 1);
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  vector<pair<long long int, long long int> > v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  long long int sum = 0;
  vector<long long int> a;
  for (long long int i = n - 1; i >= n - k; i--) {
    sum += v[i].first;
    a.push_back(v[i].second);
  }
  sort(a.begin(), a.end());
  long long int ans = 1;
  for (long long int i = 0; i < k - 1; i++) {
    ans *= (a[i + 1] - a[i]);
    ans %= 998244353;
  }
  cout << sum << " " << ans;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
