#include using namespace std; int main(void){ int n, k; cin >> n >> k; vector ct(n); int a; for (int i = 0; i < n; i++) { cin >> a; ct[a-1]++; } int sum = 0, ans = 0; for (int i = 0; i < n; i++) { sum += ct[i]; if (sum >= k) { ans = i + 1; break; } } cout << ans << endl; }