#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int i,j,n,sum,k,l,x;
    cin>>n;
    int a[n];
    map<int,vector<int>>count;
    map<int,vector<int>>:: iterator mit;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        count[a[i]].push_back(i);
    }
    for(mit=count.begin();mit!=count.end();mit++)
    {
		if((mit->second).size() >=4)
		{
			vector<int>vv=mit->second;
			cout<<"YES"<<'\n';
			cout<<vv[0]+1<<" "<<vv[1]+1<<" "<<vv[2]+1<<' '<<vv[3]+1<<'\n';
			return 0;
		}
	}
    map<int,vector<pair<int,int>>>m;
    map<int,vector<pair<int,int>>>:: iterator it;
    vector<pair<int,int>>v;
    x=fmin(n,10000);
    for(i=0;i<x;i++)
    {
        for(j=i+1;j<n;j++)
        {
            sum=a[i]+a[j];
            it=m.find(sum);
            if(it !=m.end())
            {
                v=it->second;
                for(k=0;k<v.size();k++)
                {
                    if(v[k].first !=i && v[k].first !=j)
                    {
                        if(v[k].second != i && v[k].second != j)
                        {
                            cout<<"YES"<<'\n';
                            cout<<i+1<<" "<<j+1<<" ";
                            cout<<v[k].first + 1<<" "<<v[k].second + 1<<'\n';
                            return 0;
                        }
                    }
                }
            }
            m[sum].push_back({i,j});
        }
    }
    cout<<"NO"<<'\n';
}
