#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int nums[n];
  int smallest = 101;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    nums[i] = num;
    if (num < smallest) {
      smallest = num;
    }
  }
  int smallDiff = 300;
  int smallerNum = 0;
  bool passed = false;
  for (int i = 0; i < n; i++) {
    if (nums[i] != smallest) {
      if (nums[i] - smallest < smallDiff) {
        passed = true;
        smallDiff = nums[i] - smallest;
        smallerNum = nums[i];
      }
    }
  }
  if (passed)
    cout << smallerNum;
  else
    cout << "NO";
  return 0;
}
