#include #include #include using namespace std; int main() { int n; cin >> n; vector> stacks(n); for (int i = 0; i < n; i++) { cin >> stacks[i].first; stacks[i].second = i+1; } vector> moves; while (true) { sort(stacks.rbegin(),stacks.rend()); if (stacks[1].first == 0) break; moves.push_back({stacks[0].second,stacks[1].second}); stacks[0].first--; stacks[1].first--; } if (stacks[0].first == 0) { cout << "yes\n"; for (auto move : moves) { cout << move.first << " " << move.second << "\n"; } } else { cout << "no\n"; } }