#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) { return a + b - max(a, b); }
long long mulmod(long long a, long long b, long long mod) {
  return ((a % 998244353) * (b % 998244353) % 998244353);
}
long long mod(long long a, long long b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &a : v) is >> a;
  return is;
}
int bits(long long n) {
  long long ctr = 0;
  while (n) {
    n /= 10;
    ctr++;
  }
  return ctr;
}
vector<long long> bits1(long long n) {
  vector<long long> res;
  while (n) {
    res.push_back(n % 10);
    n /= 10;
  }
  reverse(res.begin(), res.end());
  return res;
}
long long logs(long long x) {
  long long tot = 0;
  long long n = x;
  while (x > 0) {
    x /= 2;
    tot++;
  }
  return tot - 1;
}
long long dp[200005];
long long cs[200005];
vector<long long> a;
void dfs(list<long long> g[], long long v, bool vis[]) {
  vis[v] = true;
  if (a[v])
    cs[v] = 1;
  else
    cs[v] = -1;
  for (auto it : g[v]) {
    if (!vis[it]) {
      dfs(g, it, vis);
      if (cs[it] > 0) cs[v] += cs[it];
    }
  }
}
void dfs1(list<long long> g[], long long v, bool vis[], long long par) {
  vis[v] = true;
  if (par == -1) {
    dp[v] = cs[v];
  } else {
    if (cs[v] > 0)
      dp[v] = max(dp[par], cs[v]);
    else
      dp[v] = max(dp[par] + cs[v], cs[v]);
  }
  for (auto it : g[v])
    if (!vis[it]) dfs1(g, it, vis, v);
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> vec(n);
  cin >> vec;
  vector<long long> indices;
  long long sums = 0;
  long long dp[200005];
  for (long long i = 0; i < n; i++) {
    if (vec[i] > (n - k)) {
      indices.push_back(i);
      sums += vec[i];
    }
  }
  cout << sums << " ";
  long long prod = 1;
  if (indices.size() == 1 || indices.size() == n) {
    cout << 1;
    return;
  }
  for (long long i = 0; i < indices.size() - 1; i++) {
    long long diff = indices[i + 1] - indices[i];
    prod = prod * (diff);
    prod = prod % 998244353;
  }
  cout << prod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
