#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> data;
  for (int _n = n, i = 0; i < _n; ++i) {
    int t;
    cin >> t;
    data.push_back(t);
  }
  vector<int> points;
  points.push_back(-1);
  points.push_back(0);
  for (int _n = data.size(), i = 0; i < _n; ++i) {
    points.push_back(data[i] - 1);
    points.push_back(data[i]);
    points.push_back(data[i] + 1);
  }
  for (int _n = points.size(), i = 0; i < _n; ++i) {
    int x = points[i];
    int cnt = 0;
    for (int _n = data.size(), j = 0; j < _n; ++j) {
      if (x >= 0 && x <= data[j]) cnt++;
    }
    if (cnt == k) {
      cout << x << " " << x;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
