#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int u;
  long long int v;
};
bool compare(string p, string q) { return (p + q > q + p); };
void dfs(vector<long long int> adj[], vector<char>& ans, long long int vis[],
         long long int x) {
  ans.push_back(x);
  vis[x] = 1;
  for (auto p : adj[x]) {
    if (!vis[p]) {
      dfs(adj, ans, vis, p);
    }
  }
}
void set_bit(vector<long long int>& n_bit, long long int n, long long int u,
             long long int x, long long int y) {
  long long int i = 0;
  while (n) {
    if (n & 1) {
      if (1 << i & u) {
        x |= 1 << i;
        y |= 1 << i;
      } else {
        u |= 1 << i;
        x |= 1 << i;
      }
    }
    n /= 2;
    i++;
  }
}
long long int recur(vector<vector<long long int> >& dp, long long int i,
                    long long int j, long long int prev, long long int h,
                    vector<long long int>& v, long long int n, long long int l,
                    long long int r) {
  if (i >= n) return 0;
  if (dp[prev][i] != -1) return dp[prev][i];
  long long int a = 0, b = 0;
  if (((v[i] - 1 + prev) % h) >= l && ((v[i] - 1 + prev) % h) <= r) a = 1;
  if (((v[i] + prev) % h) >= l && ((v[i] + prev) % h) <= r) b = 1;
  dp[prev][i] =
      max(recur(dp, i + 1, 1, (v[i] + prev) % h, h, v, n, l, r) + b,
          recur(dp, i + 1, 0, (v[i] + prev - 1) % h, h, v, n, l, r) + a);
  return dp[prev][i];
}
long long int mod_expo(long long int x, long long int y,
                       long long int m = 1000000007) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % m;
    y = y >> 1;
    x = (x * x) % m;
  }
  return res;
}
long long int mul(long long int a, long long int b,
                  long long int m = 1000000007) {
  long long int ans = ((a % m) * (b % m)) % m;
  return ans;
}
int main() {
  long long int t = 1;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    vector<long long int> v;
    for (long long int i = 0; i < n; i++) {
      long long int a;
      cin >> a;
      v.push_back(a);
    };
    long long int maxi = 0;
    long long int m = 998244353;
    long long int ans = 1;
    map<long long int, long long int> dp;
    long long int p = n;
    long long int sum = 0;
    while (k--) {
      dp[p] = 1;
      sum += p;
      p--;
    }
    long long int prev = 0;
    long long int f = 0;
    long long int l = 0;
    long long int count = 0;
    for (long long int i = 0; i < n; i++) {
      if (dp[v[i]] && f) {
        ans = mul(ans, i - prev, m);
        count = 0;
        prev = i;
      } else if (dp[v[i]] && f == 0) {
        f = 1;
        prev = i;
      }
      count++;
    }
    cout << sum << " ";
    cout << ans << endl;
  }
  return 0;
}
