/// vonat1us 

#pragma GCC optimize("O3")
//#pragma comment(linker, "/STACK:36777216")

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define sz(x) (int) x.size()
#define all(z) (z).begin(), (z).end()
 
using namespace std;

using ll = long long;
using pii = pair<int, int>;                                   

const int MOD = 1e9 + 7; 
const int INF = 1e9 + 1e2;
  
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void fin() {
#ifdef AM
    freopen(".in", "r", stdin);
#endif        
}                   

const bool flag = 0;

const int N = 1e5+10;
const int MAX = 3e6+10;

int cnt[MAX];

vector<pii> s[MAX];

void print(int d) {
    for (int j = 0; j < sz(s[d]); ++j) {
        for (int k = j+1; k < sz(s[d]); ++k) {
            pii x = s[d][j];
            pii y = s[d][k];
            if (x.x != y.x && x.x != y.y && x.y != y.x && x.y != y.y) {
                cout << "YES\n";
                cout << x.x+1 << " " << y.y+1 << " " << x.y+1 << " " << y.x+1, exit(0);
            }
        }
    }
}

void ma1n() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int& x : a) {
        cin >> x, cnt[x]++;
    }
    vector<int> two;
    for (int j = 0; j < n; ++j) {
        int x = a[j];
        if (cnt[x] >= 4) {
            cout << "YES\n";
            int t = 4;
            for (int i = 0; i < n; ++i) {
                if (a[i] == x) {
                    cout << i+1 << " ";
                    if (!--t) break;
                }
            }
            return;
        }
        if (cnt[x] >= 2 && (two.empty() || x != a[two.back()])) {
            two.pb(j);
            if (sz(two) == 2) {
                int t = 2;
                two[0] = a[two[0]];
                two[1] = a[two[1]];
                auto tt = two;
                cout << "YES\n";
                for (int i = 0; i < n; ++i) {
                    if (a[i] == two[0]) {
                        cout << i+1 << " ";
                        a[i] = -1, two[0] = -1;
                        if (!--t) break;
                    }
                    if (a[i] == two[1]) {
                        cout << i+1 << " ";
                        a[i] = -1, two[1] = -1;
                        if (!--t) break;
                    }
                }
                two = tt;
                t = 2;
                for (int i = 0; i < n; ++i) {
                    if (a[i] == -1) continue;
                    if (a[i] == two[0]) {
                        cout << i+1 << " ";
                        a[i] = -1, two[0] = -1;
                        if (!--t) break;
                    }
                    if (a[i] == two[1]) {
                        cout << i+1 << " ";
                        a[i] = -1, two[1] = -1;
                        if (!--t) break;
                    }
                }
                return;            
            }
        }
    }
    vector<pii> b(n);
    for (int i = 0; i < n; ++i) {
        b[i].x = a[i], b[i].y = i;        
    }
    sort(all(b));
    for (int i = 1; i < n; ++i) {
        if (cnt[b[i].x] == 3 && b[i].x == b[i-1].x) {
            b.erase(b.begin()+i);
            break;
        }
    }
    n = sz(b);
    for (int i = 0; i < n-1; ++i) {
        for (int j = i+1; j < n; ++j) {
            int d = b[j].x-b[i].x;
            s[d].pb({b[i].y, b[j].y});
            if (sz(s[d]) < 4 && sz(s[d]) > 1) {
                print(d);
            }
        }
    }
    cout << "NO";
} 

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr), fin();
    int ts = 1;
    if (flag) {
        cin >> ts;
    }
    while (ts--) {
        ma1n(); 
    }
    return 0;
}