#include <bits/stdc++.h>
using namespace std;
long long int n, m, cases, t, ans;
string s, s2, s3;
long long int ar[(int)(1e6 + 10)], ar2[(int)(1e6 + 10)], cum[(int)(1e6 + 10)];
void brainfuck();
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  brainfuck();
  return 0;
}
void brainfuck() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  sort(ar + 1, ar + n + 1);
  for (int i = 1; i <= n; i++) cum[i] = cum[i - 1] + ar[i];
  int le = 1;
  for (int i = 1; i <= n; i++) {
    while (le < i && ar[i] * (i - le + 1) - (cum[i] - cum[le - 1]) > m) le++;
    if (i - le + 1 > ans) {
      ans = i - le + 1;
      t = ar[i];
    }
  }
  cout << ans << " " << t;
}
