#include <bits/stdc++.h>
using namespace std;
const long long N = 2 * 1e5 + 100;
long long n, k, a[N], b[N], ans;
struct node {
  long long num, id;
} sh[N];
bool cmp(node a, node b) { return a.num > b.num; }
inline void add(long long &a, long long b) {
  a = ((a + b >= 998244353) ? a + b - 998244353 : a + b);
}
inline void del(long long &a, long long b) {
  a = ((a - b < 0) ? a - b + 998244353 : a - b);
}
inline void mul(long long &a, long long b) { a = a * b % 998244353; }
inline long long m_pow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) mul(ans, a);
    b >>= 1;
    mul(a, a);
  }
  return ans;
}
inline void ckmin(long long &a, long long b) { a = ((a < b) ? a : b); }
inline void ckmax(long long &a, long long b) { a = ((a > b) ? a : b); }
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
signed main() {
  n = read();
  k = read();
  for (long long i = 1; i <= n; i++) a[i] = read(), sh[i] = (node){a[i], i};
  sort(sh + 1, sh + 1 + n, cmp);
  for (long long i = 1; i <= k; i++) b[i] = sh[i].id;
  sort(b + 1, b + 1 + k);
  ans = 1;
  for (long long i = 1; i < k; i++) mul(ans, b[i + 1] - b[i]);
  long long sum = 0;
  for (long long i = 1; i <= k; i++) sum += sh[i].num;
  printf("%lld %lld\n", sum, ans);
}
