#include <iostream>
using namespace std;
int ternarySearch(int arr[], int n, int x) {
int left = 0, right = n - 1;
while (left <= right) {
int mid1 = left + (right - left) / 3;
int mid2 = right - (right - left) / 3;
if (arr[mid1] == x) return mid1;
if (arr[mid2] == x) return mid2;
if (x < arr[mid1])
right = mid1 - 1;
else if (x > arr[mid2])
left = mid2 + 1;
else
left = mid1 + 1, right = mid2 - 1;
}
return -1;
}
int main() {
int n,target;
cin >> n >> target;
int a[n];
for(int i = 0;i<n;i++){
cin >> a[i];
}
int result = ternarySearch(a, n, target);
if(result==1) cout << "FOUND";
else cout << "NOT FOUND";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHRlcm5hcnlTZWFyY2goaW50IGFycltdLCBpbnQgbiwgaW50IHgpIHsKICAgIGludCBsZWZ0ID0gMCwgcmlnaHQgPSBuIC0gMTsKICAgIAogICAgd2hpbGUgKGxlZnQgPD0gcmlnaHQpIHsKICAgICAgICBpbnQgbWlkMSA9IGxlZnQgKyAocmlnaHQgLSBsZWZ0KSAvIDM7CiAgICAgICAgaW50IG1pZDIgPSByaWdodCAtIChyaWdodCAtIGxlZnQpIC8gMzsKCiAgICAgICAgaWYgKGFyclttaWQxXSA9PSB4KSByZXR1cm4gbWlkMTsKICAgICAgICBpZiAoYXJyW21pZDJdID09IHgpIHJldHVybiBtaWQyOwoKICAgICAgICBpZiAoeCA8IGFyclttaWQxXSkKICAgICAgICAgICAgcmlnaHQgPSBtaWQxIC0gMTsgIAogICAgICAgIGVsc2UgaWYgKHggPiBhcnJbbWlkMl0pCiAgICAgICAgICAgIGxlZnQgPSBtaWQyICsgMTsgICAKICAgICAgICBlbHNlCiAgICAgICAgICAgIGxlZnQgPSBtaWQxICsgMSwgcmlnaHQgPSBtaWQyIC0gMTsgIAogICAgfQogICAgCiAgICByZXR1cm4gLTE7ICAKfQoKaW50IG1haW4oKSB7CglpbnQgbix0YXJnZXQ7CgljaW4gPj4gbiA+PiB0YXJnZXQ7CglpbnQgYVtuXTsKCWZvcihpbnQgaSA9IDA7aTxuO2krKyl7CgkJY2luID4+IGFbaV07Cgl9CiAgIGludCByZXN1bHQgPSB0ZXJuYXJ5U2VhcmNoKGEsIG4sIHRhcmdldCk7CiAgIGlmKHJlc3VsdD09MSkgY291dCA8PCAiRk9VTkQiOwogICBlbHNlIGNvdXQgPDwgIk5PVCBGT1VORCI7CiAKICAgcmV0dXJuIDA7Cn0=