#include <bits/stdc++.h>
using namespace std;
const int p = 998244353;
template <typename T>
inline T read() {
  register T sum = 0;
  register char cc = getchar();
  int sym = 1;
  while (cc != '-' && (cc > '9' || cc < '0')) cc = getchar();
  if (cc == '-') sym = -1, cc = getchar();
  sum = sum * 10 + cc - '0';
  cc = getchar();
  while (cc >= '0' && cc <= '9') sum = sum * 10 + cc - '0', cc = getchar();
  return sym * sum;
}
template <typename T>
inline T read(T& a) {
  a = read<T>();
  return a;
}
template <typename T, typename... Others>
inline void read(T& a, Others&... b) {
  a = read(a);
  read(b...);
}
int n, K, cnt, ans2 = 1, a[200010], b[200010], c[200010], d[200010],
               vis[200010];
long long ans;
int main() {
  read(n, K);
  for (int i = 1; i <= n; i++) {
    read(a[i]);
    b[i] = a[i];
    d[a[i]] = i;
  }
  sort(b + 1, b + 1 + n);
  for (int i = n; i > n - K; i--) {
    vis[d[b[i]]] = true;
    ans += b[i];
  }
  vis[0] = vis[n + 1] = true;
  printf("%lld ", ans);
  for (int i = 0, j = 1; i <= n; i = j) {
    j = i + 1;
    while (j <= n + 1 && !vis[j]) j += 1;
    c[++cnt] = j - i;
  }
  for (int i = 2; i < cnt; i++) ans2 = 1ll * ans2 * c[i] % p;
  printf("%d\n", ans2);
  return 0;
}
