#include <bits/stdc++.h>
using namespace std;
int n, x, ans = 101, minn = 101;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x == minn || x == ans) {
      continue;
    }
    if (x < minn) {
      ans = minn;
      minn = x;
    } else if (x < ans) {
      ans = x;
    }
  }
  if (ans == 101) {
    cout << "NO";
  } else {
    cout << ans;
  }
  return 0;
}
