#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e7 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long k;
  cin >> k;
  map<long long, long long> mp;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a, a + n);
  long long s = 0, freq = 0;
  for (auto i = mp.begin(); i != mp.end(); i++) {
    if (i->second > freq) {
      freq = i->second;
      s = i->first;
    }
  }
  if (k == 0) {
    cout << freq << " " << s;
    return 0;
  }
  long long pref[n + 5];
  pref[0] = 0;
  for (long long i = 0; i < n; i++) pref[i + 1] = pref[i] + a[i];
  long long start = 0, end = 0, maxi = 0;
  long long ans;
  while (end < n) {
    long long len = end - start + 1;
    long long p = len * a[end] - (pref[end + 1] - pref[start]);
    if (maxi < len && p <= k) {
      maxi = len;
      ans = a[end];
    }
    if (p <= k)
      end++;
    else
      start++;
  }
  cout << maxi << " " << ans;
}
