#include<bits/stdc++.h>
#define ll long long
const int md=1000000007;
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
/* VECTORS */
#define pb push_back
#define co(v,x) count(v.begin(),v.end(),x)
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define vi vector<int>
#define vll vector<ll>
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.begin(),v.end(),greater<int>())
/* INPUT/OUTPUT*/
#define pr printf
#define sc scanf
#define pi(a) printf("%d\n",a)
#define pll(a) printf("%lld\n",a)
#define si(a) scanf("%d",&a)
#define sll(a) scanf("%lld",&a)
/* LOOPS*/
#define fi(i,a,b) for(int i=a;i<b;i++)
#define fll(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
using namespace std::chrono;
ll pw(ll a, ll b)
{
    ll c=1,m=a;
    while (b)
    {
        if(b&1) c=(c * m);
        m=(m*m);
        b/=2;
    }
    return c;
}
ll pwmd(ll a,ll b)
{
    ll c=1,m=a;
    while(b)
    {
        if(b&1) c=(c*m)%md;
        m=(m*m)%md;
        b/=2;
    }
    return c;
}
ll modinv(ll n)
{
    return pwmd(n, md - 2);
}
ll ceel(ll a,ll b)
{
    if(a%b==0) return a/b;
    else return a/b+1;
}
ll my_log(ll n, ll b)
{
    ll i=1;
    ll ans=0;
    while(1)
    {
        if(i>n)
        {
            ans--;
            break;
        }
        if(i==n) break;
        i*=b;
        ans++;
    }
    return ans;
}
bool is(string r)
{
    string p = r;
    reverse(p.begin(), p.end());
    return (r == p);
}
int l_p_p(const string &s)
{
    string kmprev = s;
    std::reverse(kmprev.begin(), kmprev.end());
    string kmp = s + "#" + kmprev;
    vector<int> lps(kmp.size(), 0);
    for (int i = 1; i < (int)lps.size(); ++i)
    {
        int prev_idx = lps[i - 1];
        while (prev_idx > 0 && kmp[i] != kmp[prev_idx])
        {
            prev_idx = lps[prev_idx - 1];
        }
        lps[i] = prev_idx + (kmp[i] == kmp[prev_idx] ? 1 : 0);
    }
    return lps[lps.size() - 1];
}
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
   /* auto start = high_resolution_clock::now();
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    cerr << "Time taken: "
         << duration.count()<< "ms" <<"\n";*/
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
int main()
{
    fast;
    int n,m,d,c,s=0;
    cin>>n>>m>>d;
    vi v;
    fi(i,0,m) cin>>c,v.pb(c),s+=c;
    v.pb(0);
    if(s+(m+1)*(d-1)<n) cout<<"NO";
    else
    {
        cout<<"YES\n";
        if(d==1)
        {
            fi(i,0,m)
            {
                fi(j,0,v[i]) cout<<i+1<<" ";
            }
        }
        else
        {
        int x=n-s;
        int y=x/(d-1);
        int z=x%(d-1);
        fi(i,0,y)
        {
            fi(j,0,d-1) cout<<0<<" ";
            fi(j,0,v[i]) cout<<i+1<<" ";
        }
        fi(i,0,z) cout<<0<<" ";
        fi(i,y,m)
        {
            fi(j,0,v[i]) cout<<i+1<<" ";
        }
        }
    }
}


#include<bits/stdc++.h>
#define ll long long
const int md=1000000007;
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
/* VECTORS */
#define pb push_back
#define co(v,x) count(v.begin(),v.end(),x)
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define vi vector<int>
#define vll vector<ll>
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.begin(),v.end(),greater<int>())
/* INPUT/OUTPUT*/
#define pr printf
#define sc scanf
#define pi(a) printf("%d\n",a)
#define pll(a) printf("%lld\n",a)
#define si(a) scanf("%d",&a)
#define sll(a) scanf("%lld",&a)
/* LOOPS*/
#define fi(i,a,b) for(int i=a;i<b;i++)
#define fll(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
using namespace std::chrono;
ll pw(ll a, ll b)
{
    ll c=1,m=a;
    while (b)
    {
        if(b&1) c=(c * m);
        m=(m*m);
        b/=2;
    }
    return c;
}
ll pwmd(ll a,ll b)
{
    ll c=1,m=a;
    while(b)
    {
        if(b&1) c=(c*m)%md;
        m=(m*m)%md;
        b/=2;
    }
    return c;
}
ll modinv(ll n)
{
    return pwmd(n, md - 2);
}
ll ceel(ll a,ll b)
{
    if(a%b==0) return a/b;
    else return a/b+1;
}
ll my_log(ll n, ll b)
{
    ll i=1;
    ll ans=0;
    while(1)
    {
        if(i>n)
        {
            ans--;
            break;
        }
        if(i==n) break;
        i*=b;
        ans++;
    }
    return ans;
}
bool is(string r)
{
    string p = r;
    reverse(p.begin(), p.end());
    return (r == p);
}
int l_p_p(const string &s)
{
    string kmprev = s;
    std::reverse(kmprev.begin(), kmprev.end());
    string kmp = s + "#" + kmprev;
    vector<int> lps(kmp.size(), 0);
    for (int i = 1; i < (int)lps.size(); ++i)
    {
        int prev_idx = lps[i - 1];
        while (prev_idx > 0 && kmp[i] != kmp[prev_idx])
        {
            prev_idx = lps[prev_idx - 1];
        }
        lps[i] = prev_idx + (kmp[i] == kmp[prev_idx] ? 1 : 0);
    }
    return lps[lps.size() - 1];
}
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
   /* auto start = high_resolution_clock::now();
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    cerr << "Time taken: "
         << duration.count()<< "ms" <<"\n";*/
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
int main()
{
    fast;
    int n,m,d,c,s=0;
    cin>>n>>m>>d;
    vi v;
    fi(i,0,m) cin>>c,v.pb(c),s+=c;
    v.pb(0);
    if(s+(m+1)*(d-1)<n) cout<<"NO";
    else
    {
        cout<<"YES\n";
        int x=n-s;
        int y=x/(d-1);
        int z=x%(d-1);
        fi(i,0,y)
        {
            fi(j,0,d-1) cout<<0<<" ";
            fi(j,0,v[i]) cout<<i+1<<" ";
        }
        fi(i,0,z) cout<<0<<" ";
        fi(i,y,m)
        {
            fi(j,0,v[i]) cout<<i+1<<" ";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[1200];
int len[1200],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * d >= n+1){
        cout << "Yes\n";
        int sumdelta = n+1-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d <= sumdelta) now+=d;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[1200];
int len[1200],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * d >= n+1 && sum <= n){
        cout << "Yes\n";
        int sumdelta = n+1-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d <= sumdelta) now+=d;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[2000];
int len[2000],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * d >= n+1 && sum <= n){
        cout << "Yes\n";
        int sumdelta = n-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d <= sumdelta) now+=d;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[20000];
int len[20000],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * (d-1) >= n){
        cout << "Yes\n";
        int sumdelta = n-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d - 1 <= sumdelta) now+=d-1;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            now++;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[2000];
int len[2000],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * (d-1) >= n){
        cout << "Yes\n";
        int sumdelta = n-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d - 1 <= sumdelta) now+=d-1,sumd+=d-1;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            now++;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,m,d,ans[20000];
int len[20000],sum;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m >> d;
    for(int i = 0; i < m; ++i) cin >> len[i],sum += len[i];
    if(sum + (m+1) * d >= n+1 && sum <= n){
        cout << "Yes\n";
        int sumdelta = n-sum;
        int now = 0,cur = 0,sumd = 0;
        while(cur < m){
            if(sumd + d - 1 <= sumdelta) now+=d-1;
            else if(sumd != sumdelta) now += sumdelta-sumd,sumd = sumdelta;
            now++;
            for(int i = now; i <= now+len[cur]-1; ++i) ans[i]=cur+1;
            now += len[cur]-1;
            cur++;
        }
        for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
    }
    else cout << "NO\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if((d-1)*(n+1)+sum<l)
    {
        printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(dd>d){
        printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    cout<<more<<" "<<dd<<endl;
    if(d==1 && sum<l) goto no;
    if(dd>d){
no:     printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    //cout<<p<<endl;
    if(p+d<=l+1) goto no;
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(d*(n+1)+sum<l)
    {
        printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(dd>d){
        printf("NO");
        return 0;
    }
    int p=0;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(d==1 && sum<l) goto no;
    if(dd>d){
no:     printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(dd>=d){
        printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(d==1 && sum<l) goto no;
    if(dd>d){
no:     printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<min(dd,d);++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    //cout<<p<<endl;
    if(p+d<=l+1) goto no;
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
int l,n,d;
int sum,num[maxn];
int a[maxn];
int mceil(int n,int m){
    if(n%m) return n/m+1;
    else return n/m;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>l>>n>>d;
    for(int i=1;i<=n;++i){
        cin>>num[i];
        sum+=num[i];
    }
    int dd=mceil(l+1-sum,n+1);
    int more=dd*n+sum-l;
    //cout<<more<<" "<<dd<<endl;
    if(d==1 && sum<l) goto no;
    if(dd>d){
no:     printf("NO");
        return 0;
    }
    int p=0;
    if(dd==1) ++p;
    for(int i=1;i<=n;++i){
        if(i<=more){
            for(int j=1;j<dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }else{
            for(int j=1;j<=dd;++j) a[p++]=0;
            for(int j=1;j<=num[i];++j) a[p++]=i;
        }
    }
    //cout<<p<<endl;
    if(p+d<=l+1) goto no;
    cout<<"YES"<<endl;
    for(int i=1;i<=l;++i) cout<<a[i]<<" ";
    cout<<endl;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(x == n) return;
	if(pc == m) {
		if(x+d < n) {
			cout << "NO";
			exit(0);
		}
		return;
	}
	tot -= c[pc];
	if(c[pc] >= d) {
		mark(x+1, x+c[pc], pc);
		go(x+c[pc], pc+1);
		return;
	}
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {

	if(pc == m) {
		if(x+d >= n) return;
		cout << "NO";
		exit(0);
	}
	tot -= c[pc];
	// //current peice bigger than the jump
	// if(c[pc] >= d) {
	// 	mark(x+1, x+c[pc], pc);
	// 	go(x+c[pc], pc+1);
	// 	return;
	// }
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	if(hi < x+c[pc]) {
		cout << "NO";
		exit(0);
	}
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(x == n) return;
	tot -= c[pc];
	if(c[pc] >= d) {
		mark(x+1, x+c[pc], pc);
		go(x+c[pc], pc+1);
		return;
	}
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n - 1);
	hi -= ex;
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(x == n) return;
	if(pc == m) {
		if(x+d < n) {
			cout << "NO";
			exit(0);
		}
		return;
	}
	tot -= c[pc];
	if(c[pc] >= d) {
		mark(x+1, x+c[pc], pc);
		go(x+c[pc], pc+1);
		return;
	}
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	if(hi < x+c[pc]) {
		cout << "NO";
		exit(0);
	}
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	// cout << x << " " << pc << endl;
	if(pc == m) {
		if(x+d > n) return;
		cout << "NO";
		exit(0);
	}

	tot -= c[pc];

	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	if(hi < x+c[pc]) {
		cout << "NO";
		exit(0);
	}
	mark(hi-c[pc]+1, hi, pc);
	// cout << "Stepped at " << hi << " " << pc + 1 << endl;
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(x == n) return;
	tot -= c[pc];
	if(c[pc] >= d) {
		mark(x+1, x+c[pc], pc);
		go(x+c[pc], pc+1);
		return;
	}
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(pc == m) {
		if(x+d >= n) return;
		cout << "NO";
		exit(0);
	}
	tot -= c[pc];
	// //current peice bigger than the jump
	// if(c[pc] >= d) {
	// 	mark(x+1, x+c[pc], pc);
	// 	go(x+c[pc], pc+1);
	// 	return;
	// }
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	// if(hi < x+c[pc]) {
	// 	cout << "NO";
	// 	exit(0);
	// }
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


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

const int N = 1003;
int ans[N], c[N];

int n, m, d, tot = 0;
void mark(int lo, int hi, int val) {
	for(int i = lo; i <= hi; i++)
		ans[i] = val+1;
}
void go(int x, int pc) {
	if(x+d >= n) return;
	if(pc == m) {
		cout << "NO";
		exit(0);
	}
	tot -= c[pc];
	// //current peice bigger than the jump
	// if(c[pc] >= d) {
	// 	mark(x+1, x+c[pc], pc);
	// 	go(x+c[pc], pc+1);
	// 	return;
	// }
	int hi = x+d+c[pc]-1;
	int extend = hi + tot;
	int ex = max(0, extend - n);
	hi -= ex;
	// if(hi < x+c[pc]) {
	// 	cout << "NO";
	// 	exit(0);
	// }
	mark(hi-c[pc]+1, hi, pc);
	go(hi, pc+1);
}

int main() {

	cin >> n >> m >> d;

	for(int i = 0; i < m; i++) cin >> c[i], tot += c[i];
	go(0, 0);
	cout << "YES\n";
	for(int i = 1; i <= n; i++) cout << ans[i] << " ";
	return 0;
}


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

signed main()
{
   ios
   int n,m,d;
    cin >> n >> m >> d;
    int c[m+1];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if((n-s)/(m+1)>d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << '0' << " ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

signed main()
{
   ios
   int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if((n-s)/(m+1)>=d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << '0' << " ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    int c[2000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

    vector <int> ups;

signed main()
{
   ios
   /*int q;
   cin >> q;
   while (q--) {
    int n,k;
    string s;
    cin >> n >> k;
    cin >> s;
    for (int i=0;i<n;i++) {
        a[i] = s[i] - '0';
        if (a[i]==0) ups.push_back(i);
    }
    int d=0;
  //  for (int i=0;i<ups.size();i++)
  //      cout << ups[i] << " ";
    //cout << endl;
    for (int i=0;i<ups.size();i++) {
        if (ups[i]>d)  {
                if (k-ups[i]+d>=0) {
                    k = k-ups[i]+d;
                    ups[i]=d;
                    d++;
                   // cout << ups[i] << " ";
                }
                else {
                        if (k>0) {
                            ups[i]=ups[i]-k;
                            //cout << ups[i] << " ";
                            break;
                        }
                }
        }
    }
  //  cout << endl;
    for (int i=0;i<n;i++) {
        c[i]=1;
    }
    for (int i=0;i<ups.size();i++)
        c[ups[i]]=0;
    for (int i=0;i<n;i++) {
            cout << c[i];
    }
    cout << endl;
   }*/
    int n,m,d;
    cin >> n >> m >> d;
    int c[m+1];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if((n-s)/(m+1)>d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << "0 ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    int c[2000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

    vector <int> ups;

signed main()
{
   ios
   /*int q;
   cin >> q;
   while (q--) {
    int n,k;
    string s;
    cin >> n >> k;
    cin >> s;
    for (int i=0;i<n;i++) {
        a[i] = s[i] - '0';
        if (a[i]==0) ups.push_back(i);
    }
    int d=0;
  //  for (int i=0;i<ups.size();i++)
  //      cout << ups[i] << " ";
    //cout << endl;
    for (int i=0;i<ups.size();i++) {
        if (ups[i]>d)  {
                if (k-ups[i]+d>=0) {
                    k = k-ups[i]+d;
                    ups[i]=d;
                    d++;
                   // cout << ups[i] << " ";
                }
                else {
                        if (k>0) {
                            ups[i]=ups[i]-k;
                            //cout << ups[i] << " ";
                            break;
                        }
                }
        }
    }
  //  cout << endl;
    for (int i=0;i<n;i++) {
        c[i]=1;
    }
    for (int i=0;i<ups.size();i++)
        c[ups[i]]=0;
    for (int i=0;i<n;i++) {
            cout << c[i];
    }
    cout << endl;
   }*/
    int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(ll i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }

    if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)>d)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES"; << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << "0 ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

signed main()
{
   ios
   int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if (n-s==d)
        cout << "NO";
    else if((n-s)/(m+1)>=d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << '0' << " ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

signed main()
{
   ios
   int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if (s+(m+1)*d<=n)
        cout << "NO";
    else if((n-s)/(m+1)>=d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << '0' << " ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];
    int a[1001];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

int res[1001];
int n,m,d;

signed main()
{
    ios
    cin >> n >> m >> d;
	int sum = 0;
	for (int i = 1; i <= m; i++)
	{
		cin >> a[i];
		sum += d + a[i] - 1;
	}
	sum += d;
	if (sum > n)
	{
		cout << "Yes" << endl;
		int pos = 1;
		int s = 0;
		for (int i = 1; i <= m; i++)
		{
			s += d - 1;
			if (sum - s > n)
			{
				int j;
				for (j = pos; j <= pos + a[i] - 1; j++)
					res[j] = i;
				pos = j;
			}
			else
			{
				int j;
				for (j = pos + d - 1; j <= pos + d + a[i] - 2; j++)
					res[j] = i;
				pos = j;
			}
		}
		for (int i = 1; i <= n; i++)
			cout << res[i] << ' ';
		cout << endl;
	}
	else
		cout << "No" << endl;
	return 0;
}


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

signed main()
{
   ios
   int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(int i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }
    if (n-s==d || n-s>=d)
        cout << "NO";
    else if((n-s)/(m+1)>=d)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << '0' << " ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1 << " ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << '0' << " ";
    }
   }


#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>

using namespace std;

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define double long double
#define int long long

 int MD = 1000000007;

double binpow (double a, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 1)
    return (binpow (a, n-1) * a);
  else {
    double b = (binpow (a, n/2));
    return (b * b);
  }

}
const long long INF = 1e18;
    map <int,int> used;
    vector <int> ab;
    vector <int> cb;
    int a[2000000],k;
    pair<int,int> t[4000000];
    int c[2000000];
    double x,y;
     int loop=1;
    int push[4000000];
    int solve[1000];

/*
bool checker(int c) {
    double k = (c/x)+(c/y);
    //cout << k << endl;
    if (k>=n) return true;
    else return false;
}

int bin_search(int l,int r) {
    int m;
    while (r - l > 1) {
    m = (l+r)/2;
    //cout << m << endl;
    if (checker(m)) r = m;
        else l = m;
}
    return r;
}
*/
void doPush(int v,int tl,int tr) {
    if (push[v]!=-1) {
        if (tl!=tr) {
            push[v*2] = push[v];
            push[v*2+1] = push[v];
        }

        t[v].first = push[v];
        t[v].second = tl;
        //t[v].second = tl;
        push[v]=-1;
    }
}

void build (int v,int tl,int tr) {
    //doPush(v,tl,tr);
    if (tl==tr) {
        t[v].first = a[tl];
        t[v].second = tl;
        return;
    }
    int tm = (tl+tr)/2;
    build (v*2,tl,tm);
    build (v*2+1,tm+1,tr);
    t[v] = min(t[v*2],t[v*2+1]);
}

pair <int,int> get(int v,int tl,int tr,int l,int r) {
    doPush(v,tl,tr);
    if (l>r) return {INF, INF};
    if (tl==l && tr==r)  {
            return t[v];
    }
    int tm = (tl+tr)/2;
    return min(get(v*2,tl,tm,l,min(r,tm)),get(v*2+1,tm+1,tr,max(tm+1,l),r));
}

void update(int v,int tl,int tr,int l,int r,int val) {
    doPush(v,tl,tr);
    if (l>r) return;
   // cout << tl << " " << tr << endl;
    if (tl==l && tr==r)  {
            push[v] = val;
            doPush(v,tl,tr);
            return;
    }
    int tm = (tl+tr)/2;
    update(v*2,tl,tm,l,min(tm,r),val);
    update(v*2 + 1,tm+1,tr,max(tm+1,l),r,val);
    t[v] = min(t[v*2],t[v*2+1]);
}
    char st[105][105];
    int dp[100001];

    pair<int,int> ret[4000000];

    bool cmp(pair<int,int> a, pair<int,int> b) {
        if (b.second>a.second) return true;
            else return false;
    }

    vector <int> ups;

signed main()
{
   ios
   /*int q;
   cin >> q;
   while (q--) {
    int n,k;
    string s;
    cin >> n >> k;
    cin >> s;
    for (int i=0;i<n;i++) {
        a[i] = s[i] - '0';
        if (a[i]==0) ups.push_back(i);
    }
    int d=0;
  //  for (int i=0;i<ups.size();i++)
  //      cout << ups[i] << " ";
    //cout << endl;
    for (int i=0;i<ups.size();i++) {
        if (ups[i]>d)  {
                if (k-ups[i]+d>=0) {
                    k = k-ups[i]+d;
                    ups[i]=d;
                    d++;
                   // cout << ups[i] << " ";
                }
                else {
                        if (k>0) {
                            ups[i]=ups[i]-k;
                            //cout << ups[i] << " ";
                            break;
                        }
                }
        }
    }
  //  cout << endl;
    for (int i=0;i<n;i++) {
        c[i]=1;
    }
    for (int i=0;i<ups.size();i++)
        c[ups[i]]=0;
    for (int i=0;i<n;i++) {
            cout << c[i];
    }
    cout << endl;
   }*/
    int n,m,d;
    cin >> n >> m >> d;
    int c[m];
    int s=0;
    for(ll i=0;i<m;i++)
    	{
    	    cin >> c[i];
    	    s+=c[i];
        }

    if((n-s)/(m+1)==d && (n-s)%(m+1)!=0)
    {
    	cout << "NO";
    }
    else if((n-s)/(m+1)>d)
    {
    	cout << "NO";
    }
    else
    {
    	cout << "YES" << endl;
    	int a=(n-s)/(m+1);
    	int b=(n-s)%(m+1);

    	for(int j=0;j<m;j++)
    	{
    		if(b>0)
    		{
    			for(int i=0;i<=a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    			b--;
    		}
    		else
    		{
    			for(int i=0;i<a;i++)
    				cout << "0 ";
    			for(int i=0;i<c[j];i++)
    				cout << j+1<<" ";
    		}
    	}
    	for(int i=0;i<a;i++)
            cout << "0 ";
    }
   }


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    double n, m, d;
    double s = 0;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i], s += a[i];
    if ((n - s) / (m + 1) > d)
    {
        cout << "NO\n";
        return 0;
    }
    int cnt = n - s, idx = 0;
    vector<int> res(n + 2, 0);
    for (int i = 0; i <= n + 1;)
    {
        if (cnt >= d)
        {
            cnt -= d - 1;
            i += d;
            rep(j, i, i + a[idx]) res[j] = idx + 1;
            i += a[idx] - 1;
        }
        else
        {
            i += cnt;
            for (int k = idx; k < m; k++)
            {
                for (int c = 0; c < a[k]; c++)
                {
                    res[i + c] = k + 1;
                }
                i += a[k];
            }
            break;
        }
        // if (f)
        // {
        //     cnt -= d;
        //     i += d;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        //     i += a[idx] - 1;
        // }
        // else
        // {
        //     cnt -= 2;
        //     spaces--;
        //     i += 2;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        // }
        idx++;
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    double n, m, d;
    double s = 0;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i], s += a[i];
    if ((n - s)+1 >= (m + 1) * d)
    {
        cout << "NO\n";
        return 0;
    }
    int cnt = n - s, idx = 0;
    vector<int> res(n + 2, 0);
    for (int i = 0; i <= n + 1;)
    {
        if (cnt >= d)
        {
            cnt -= d - 1;
            i += d;
            rep(j, i, i + a[idx]) res[j] = idx + 1;
            i += a[idx] - 1;
        }
        else
        {
            i += cnt;
            if(!i) i++;
            for (int k = idx; k < m; k++)
            {
                for (int c = 0; c < a[k]; c++)
                {
                    res[i + c] = k + 1;
                }
                i += a[k];
            }
            break;
        }
        // if (f)
        // {
        //     cnt -= d;
        //     i += d;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        //     i += a[idx] - 1;
        // }
        // else
        // {
        //     cnt -= 2;
        //     spaces--;
        //     i += 2;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        // }
        idx++;
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    int n, m, d;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i];
    int idx = 0, f = 1;
    vector<int> res(n + 2, 0);
    for (int i = d; i <= n && idx < m;)
    {
        rep(j, i, i + a[idx])
        {
            res[j] = idx + 1;
        }
        i += d + a[idx] - 1;
        idx++;
        if (idx == m)
            if (i < n)
            {
                cout << "NO\n";
                return 0;
            }
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    double n, m, d;
    double s = 0;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i], s += a[i];
    if ((n - s)+1 >= (m + 1) * (d-1))
    {
        cout << "NO\n";
        return 0;
    }
    int cnt = n - s, idx = 0;
    vector<int> res(n + 2, 0);
    for (int i = 0; i <= n + 1;)
    {
        if (cnt >= d)
        {
            cnt -= d - 1;
            i += d;
            rep(j, i, i + a[idx]) res[j] = idx + 1;
            i += a[idx] - 1;
        }
        else
        {
            i += cnt;
            if(!i) i++;
            for (int k = idx; k < m; k++)
            {
                for (int c = 0; c < a[k]; c++)
                {
                    res[i + c] = k + 1;
                }
                i += a[k];
            }
            break;
        }
        // if (f)
        // {
        //     cnt -= d;
        //     i += d;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        //     i += a[idx] - 1;
        // }
        // else
        // {
        //     cnt -= 2;
        //     spaces--;
        //     i += 2;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        // }
        idx++;
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    double n, m, d;
    double s = 0;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i], s += a[i];
    if ((n - s) > (m + 1) * (d-1))
    {
        cout << "NO\n";
        return 0;
    }
    int cnt = n - s, idx = 0;
    vector<int> res(n + 2, 0);
    for (int i = 0; i <= n + 1;)
    {
        if (cnt >= d)
        {
            cnt -= d - 1;
            i += d;
            rep(j, i, i + a[idx]) res[j] = idx + 1;
            i += a[idx] - 1;
        }
        else
        {
            i += cnt;
            if(!i) i++;
            for (int k = idx; k < m; k++)
            {
                for (int c = 0; c < a[k]; c++)
                {
                    res[i + c] = k + 1;
                }
                i += a[k];
            }
            break;
        }
        // if (f)
        // {
        //     cnt -= d;
        //     i += d;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        //     i += a[idx] - 1;
        // }
        // else
        // {
        //     cnt -= 2;
        //     spaces--;
        //     i += 2;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        // }
        idx++;
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    int n, m, d;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i];
    int idx = 0, f = 1;
    vector<int> res(n + 2, 0);
    for (int i = min(d, n); i <= n && idx < m;)
    {
        rep(j, i, i + a[idx])
        {
            res[j] = idx + 1;
        }
        i += d + a[idx] - 1;
        idx++;
        if (idx == m)
            if (i < n)
            {
                cout << "NO\n";
                return 0;
            }
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef long long ll;
using namespace std;
int main()
{
    hi;
    double n, m, d;
    double s = 0;
    cin >> n >> m >> d;
    vector<int> a(m);
    rep(i, 0, m) cin >> a[i], s += a[i];
    if ((n - s)+1 >= (m + 1) * d)
    {
        cout << "NO\n";
        return 0;
    }
    int cnt = n - s, idx = 0;
    vector<int> res(n + 2, 0);
    for (int i = 0; i <= n + 1;)
    {
        if (cnt >= d)
        {
            cnt -= d - 1;
            i += d;
            rep(j, i, i + a[idx]) res[j] = idx + 1;
            i += a[idx] - 1;
        }
        else
        {
            i += cnt;
            for (int k = idx; k < m; k++)
            {
                for (int c = 0; c < a[k]; c++)
                {
                    res[i + c] = k + 1;
                }
                i += a[k];
            }
            break;
        }
        // if (f)
        // {
        //     cnt -= d;
        //     i += d;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        //     i += a[idx] - 1;
        // }
        // else
        // {
        //     cnt -= 2;
        //     spaces--;
        //     i += 2;
        //     rep(j, i, i + a[idx]) res[j] = idx + 1;
        // }
        idx++;
    }
    cout << "YES\n";
    rep(i, 1, n + 1)
    {
        cout << res[i] << ' ';
    }
    return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		return 0;
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else{
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}

	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0,j=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	if((d-1)*(m+1)<n-s)cout<<"NO\n";
	else{
		ll left=n-s;
		ll p=0;
		while(p<n){
			i=p-1;
			while(left>0&&p<i+d){
				cout<<"0 ";
				p++;left--;
			}
			while(j<m&&a[j]>0){
				cout<<j+1<<" ";
				p++;
				a[j]--;
			}
			j++;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		return 0;
	}
	while(i<n){
		if(left>0&&j<m){
			ll f=0;
			while(left>0&&f<d){
				i++;left--;f++;
			}
			if(f==d)left++;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			j++;
			i--;
		}
		else {
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}
	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0,j=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	if((d-1)*(m+1)<n-s)cout<<"NO\n";
	else{
		cout<<"YES\n";
		ll left=n-s;
		ll p=0;
		while(p<n){
			i=p-1;
			while(left>0&&p<i+d){
				cout<<"0 ";
				p++;left--;
			}
			while(j<m&&a[j]>0){
				cout<<j+1<<" ";
				p++;
				a[j]--;
			}
			j++;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else{
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}

	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else{
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}
	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		return 0;
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;

			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			left-=d;
			i--;
			j++;
		}
		else {
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}
	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		continue;
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else{
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}

	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		return 0;
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			left-=d;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else {
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}
	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


#include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define fi first
#define lb lower_bound
#define test ll int t;cin>>t;while(t--)
#define se second
#define pll pair<long long,long long>
#define icc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
}
int main(){
	icc
	ll n,m,d,i,s=0;
	cin>>n>>m>>d;
	ll a[m];
	for(i=0;i<m;i++){
		cin>>a[i];
		s+=a[i];
	}
	int fl=1;
	ll ans[n]={0};
	ll left=n-s,j=0;
	i=-1;
	if(d>n){
		i=0;
		while(j<m){
			ans[i]=j+1;
			j++;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
		return 0;
	}
	while(i<n){
		if(left>0&&j<m){
			i+=d;
			left=left-d+1;
			while(a[j]--){
				ans[i]=j+1;
				i++;
			}
			i--;
			j++;
		}
		else {
			for(;j<m;j++){
				while(a[j]--){
					ans[i]=j+1;
					i++;
				}
			}
			break;
		}
	}
	for(j=n-1;j>=0;j--){
		if(ans[j]){
			if(n+1-j>d)fl=1;
			break;
		}
		if(n+1-j>d)fl=1;
	}
	if(fl){
		cout<<"YES\n";
		for(i=0;i<n;i++)cout<<ans[i]<<" ";
		cout<<"\n";
	}
	else cout<<"NO\n";
}


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

int L[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &L[i]);
		sum += L[i];
	}
	if(sum + (m + 1) * (d - 1) < n) {puts("NO"); return 0;}
	puts("YES");
	if(d == 1){
		for(int i = 0; i < m; i++){
			for(int j = 0; j < L[i]; j++)
				cout<<i + 1<<" ";
		}
		cout<<endl;
		return 0;
	}
	int k = n - sum;
	k /= (d - 1);
	int pos = 0, cnt = 0;
	for(int i = 0; i < k; i++){
		for(int j = 0; j < d - 1; j++) cout<<"0 ";
		for(int j = 0; j < L[cnt]; j++) cout<<cnt + 1<<" ";
		pos += d - 1 + L[cnt];
		cnt++;
	}
	for(int i = cnt; i < m; i++){
		for(int j = 0; j < L[i]; j++) cout<<cnt + 1<<" ";
		pos += L[i];
	}
	for(int i = pos; i < n; i++) cout<<"0 ";
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1010],ans[1010];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=n;i++) s-=a[i];
	int nn=s/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2020],ans[2020];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	if(!s){
		for(int i=1;i<=m;i++) {
			for(int j=1;j<=a[i];j++) cout<<i<<' ';
		}
		return 0;
	}
	int nn=(s-1)/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


#include <bits/stdc++.h>
#define x first
#define y second
#define mod 1e9+7
#define NN 1005
#define eps 1e-9
#define bclz(x) (__builtin_clz(x))

using namespace std;

typedef long long INT;
typedef double DO;
typedef pair<int,int>pii;

int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[NN],b[NN];

main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
	int n,m,d,k=1,sum=0,ssum=0;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++)cin>>a[i],ssum+=a[i];
	a[m+1]=1001;
	for(int i=d;i<=n;k++){
		for(int j=1;j<=a[k];j++){
			b[i]=k;
			i++;
		}
		for(int j=1;j<d;j++){
			b[i]=0;
			i++;
		}
	}
	for(int i=1;i<=n;i++){
		if(b[i]<m)sum++;
	}
	if(sum<=ssum){
		puts("NO");
		return 0;
	}
	puts("YES");
	for(int i=1;i<=n;i++)cout<<b[i]<<' ';

	return 0;
}


#include <bits/stdc++.h>
#define NN 1010
using namespace std;
typedef long long INT;

int l[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &l[i]);
		sum += l[i];
	}
	if(sum + (m + 1) * (d - 1) >= n) puts("YES");
	else {puts("NO"); return 0;}
	sum = n - sum;
	sum /= (d - 1);
	int cnt = 0, pos = 0, L = 0;
	while(sum--){
		L += d + l[cnt];
		for(int i = 0; i < d - 1; i++) cout<<'0'<<" ", pos++;
		for(++pos; pos < L; pos++) cout<<cnt + 1<<" ";
		cnt++;
	}
	while(cnt < m){
		L += l[cnt];
		for(pos; pos < L && pos < n; pos++) cout<<cnt + 1<<" ";
		cnt++;
	}
	for(; pos < n; pos++) cout<<'0'<<" ";
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2020],ans[2020];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	if(!s){
		for(int i=1;i<=n;i++) cout<<1<<' ';
		return 0l;
	}
	int nn=s/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


#include <bits/stdc++.h>
#define x first
#define y second
#define mod 1e9+7
#define NN 1005
#define eps 1e-9
#define bclz(x) (__builtin_clz(x))

using namespace std;

typedef long long INT;
typedef double DO;
typedef pair<int,int>pii;

int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[NN],b[NN];

main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
	int n,m,d,k=1,sum=0,ssum=0;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++)cin>>a[i],ssum+=a[i];
	a[m+1]=1001;
	for(int i=d;i<=n;k++){
		for(int j=1;j<=a[k];j++){
			b[i]=k;
			i++;
		}
		for(int j=1;j<d;j++){
			b[i]=0;
			i++;
		}
	}
	for(int i=1;i<=n;i++){
		if(b[i]<m)sum++;
	}
	if(sum<=ssum)return 0;
	puts("YES");
	for(int i=1;i<=n;i++)cout<<b[i]<<' ';

	return 0;
}


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

int L[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &L[i]);
		sum += L[i];
	}
	if(sum + (m + 1) * (d - 1) < n) {puts("NO"); return 0;}
	puts("YES");
	if(d == 1){
		for(int i = 0; i < m; i++){
			for(int j = 0; j < L[1]; j++)
				cout<<i + 1<<" ";
		}
		cout<<endl;
		return 0;
	}
	int k = n - sum;
	k /= (d - 1);
	int pos = 0, cnt = 0;
	for(int i = 0; i < k; i++){
		for(int j = 0; j < d - 1; j++) cout<<"0 ";
		for(int j = 0; j < L[cnt]; j++) cout<<cnt + 1<<" ";
		pos += d - 1 + L[cnt];
		cnt++;
	}
	for(int i = cnt; i < m; i++){
		for(int j = 0; j < L[i]; j++) cout<<cnt + 1<<" ";
		pos += L[i];
	}
	for(int i = pos; i < n; i++) cout<<"0 ";
	cout<<endl;
	return 0;
}


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

int L[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &L[i]);
		sum += L[i];
	}
	if(sum + (m + 1) * (d - 1) < n) {puts("NO"); return 0;}
	if(d == 1){
		for(int i = 0; i < m; i++){
			for(int j = 0; j < L[1]; j++)
				cout<<i + 1<<" ";
		}
		cout<<endl;
		return 0;
	}
	int k = n - sum;
	k /= (d - 1);
	int pos = 0, cnt = 0;
	for(int i = 0; i < k; i++){
		for(int j = 0; j < d - 1; j++) cout<<"0 ";
		for(int j = 0; j < L[cnt]; j++) cout<<cnt + 1<<" ";
		pos += d - 1 + L[cnt];
		cnt++;
	}
	for(int i = cnt; i < m; i++){
		for(int j = 0; j < L[i]; j++) cout<<cnt + 1<<" ";
		pos += L[i];
	}
	for(int i = pos; i < n; i++) cout<<"0 ";
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2020],ans[2020];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	int nn=(s-1)/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


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

int L[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &L[i]);
		sum += L[i];
	}
	if(sum + (m + 1) * (d - 1) < n) {puts("NO"); return 0;}
	puts("YES");
	if(d == 1){
		int pos = 0;
		for(int i = 0; i < m; i++){
			for(int j = 0; j < L[i] && pos < n; j++)
				cout<<i + 1<<" ", pos++;
		}
		cout<<endl;
		return 0;
	}
	int k = n - sum;
	k /= (d - 1);
	int pos = 0, cnt = 0;
	for(int i = 0; i < k; i++){
		for(int j = 0; j < d - 1; j++) cout<<"0 ";
		for(int j = 0; j < L[cnt]; j++) cout<<cnt + 1<<" ";
		pos += d - 1 + L[cnt];
		cnt++;
	}
	for(int i = cnt; i < m; i++){
		for(int j = 0; j < L[i]; j++) cout<<cnt + 1<<" ";
		pos += L[i];
	}
	for(int i = pos; i < n; i++) cout<<"0 ";
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2020],ans[2020];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	int nn=s/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define NN 1010
int c[NN];
int pos[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n,m,d;
	scanf("%d%d%d",&n,&m,&d);
	int dst=0;
	for(int i=1;i<=m;i++) scanf("%d",&c[i]);
	for(int i=1;i<=m;i++) dst+=c[i];
	int x=dst,xx=dst;
	dst+=d*(m+1)-m;
	if(dst<n+1){
		puts("NO");
		return 0;
	}
	puts("YES");
	int st=0;
	for(int i=1;i<=m;i++){
		int len=0;
		for(int j=i;j<=m;j++) len+=c[j];
		int id=min(n-len+1,st+d);
		pos[i]=id;
		st=id+c[i]-1;
	}
	for(int i=1;i<pos[1];i++) printf("%d ",0);
	pos[m+1]=n+1;
	for(int i=1;i<=m;i++){
		for(int j=pos[i];j<pos[i]+c[i];j++) printf("%d ",i);
		for(int j=pos[i]+c[i];j<pos[i+1];j++) printf("%d ",0);
	}
//	x=(n-x)/2;
//	for(int i=1;i<=x;i++) printf("%d ",0);
//	int st=1;
//	for(int i=x+1;i<=x+xx;i++){
//		printf("%d ",st);
//		c[st]--;
//		if(!c[st]) st++;
//	}
//	for(int i=x+xx+1;i<=n;i++) printf("%d ",0);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2020],ans[2020];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	if(!s){
		for(int i=1;i<=n;i++) cout<<1<<' ';
		return 0;
	}
	int nn=(s-1)/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


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

int L[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &L[i]);
		sum += L[i];
	}
	if(sum + (m + 1) * (d - 1) < n) {puts("NO"); return 0;}
	if(d == 1){
		for(int i = 0; i < m; i++){
			for(int j = 0; j < L[1]; j++)
				cout<<i + 1<<" ";
		}
		cout<<endl;
		return 0;
	}
	int k = n - sum;
	k /= (d - 1);
	int pos = 0, cnt = 0;
	k = max(1, k);
	while(cnt < k){
		for(int i = pos; i < pos + d - 1 && i < n - 1; i++) cout<<'0'<<" ";
		pos += d - 1;
		pos = min(pos, n - 1);
		for(int i = pos; i < pos + L[cnt]; i++) cout<<cnt + 1<<" ";
		pos = pos + L[cnt];
		cnt++;
		cerr<<pos<<endl;
	}
	for(int i = pos; i < n; i++) cout<<"0 ";
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1010],ans[1010];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,m,d;
	cin>>n>>m>>d;
	for(int i=1;i<=m;i++) scanf("%d",a+i);
	int dis=(d-1)*(m+1);
	for(int i=1;i<=m;i++) dis+=a[i];
	if(dis<n) {puts("NO");return 0;}
	puts("YES");
	int s=n;
	for(int i=1;i<=m;i++) s-=a[i];
	int nn=(s-1)/(d-1);
	int st=0;
	for(int i=1;i<=nn;i++) {
		for(int j=1;j<=d-1;j++) ans[++st]=0;
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	s-=nn*(d-1);
	for(int i=1;i<=s;i++) ans[++st]=0;
	for(int i=nn+1;i<=m;i++){
		for(int j=1;j<=a[i];j++) ans[++st]=i;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
	return 0;
}


#include <bits/stdc++.h>
#define NN 1010
using namespace std;
typedef long long INT;

int l[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, m, d, sum = 0;
	scanf("%d%d%d", &n, &m, &d);
	for(int i = 0; i < m; i++){
		scanf("%d", &l[i]);
		sum += l[i];
	}
	if(sum + (m + 1) * (d - 1) >= n) puts("YES");
	else {puts("NO"); return 0;}
	sum = n - sum;
	sum /= (d - 1);
	int cnt = 0, pos = 0, L = 0;
	while(sum--){
		L += d + l[cnt];
		for(int i = 0; i < d - 1; i++) cout<<'0'<<" ", pos++;
		for(pos; pos < L - 1; pos++) cout<<cnt + 1<<" ";
		cnt++;
	}
	while(cnt < m){
		L += l[cnt];
		for(pos; pos < L && pos < n; pos++) cout<<cnt + 1<<" ";
		cnt++;
	}
	for(; pos < n; pos++) cout<<'0'<<" ";
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
   //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    if (s+(m-1)*d<n)
        cout<<"NO";
    else
        while (n>0)
        {
            int man=min(n-s+1,d);
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+d+h[id]-1;
        }
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    {
        while (n>0)
        {
            int man=min(n-s+1,d);
            if (n-s+1>d)
            {
                cout<<"NO";
                return 0;
            }
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+man+h[id]-1;
        }
    }
    cout<<"YES"<<"\n";
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    if (s+(m-1)*d<n)
        cout<<"NO";
    else
        while (n>0)
        {
            int man=min(n-s,d);
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+d+h[id];
        }
    int id1=1;
    for (int i=1;i<=n;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    if (s+m*(d-1)<n)
        cout<<"NO";
    else
    {
        cout<<"YES"<<"\n";
        while (n>0)
        {
            int man=min(n-s+1,d);
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+d+h[id]-1;
        }
    }
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    {
        while (n>0)
        {
            int man=min(n-s+1,d);
            if (n-s+1>d&&m-id==0)
            {
                cout<<"NO";
                return 0;
            }
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+man+h[id]-1;
        }
    }
    cout<<"YES"<<"\n";
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    if (s+(m-1)*d<n)
        cout<<"NO";
    else
    {
        cout<<"YES"<<"\n";
        while (n>0)
        {
            int man=min(n-s+1,d);
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+d+h[id]-1;
        }
    }
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    {
        while (n>0)
        {
            int man=min(n-s+1,d);
            if (n-s+1>d&&m-id-1==0)
            {
                cout<<"NO";
                return 0;
            }
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+man+h[id]-1;
        }
    }
    cout<<"YES"<<"\n";
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int Nmax=1e3+7;
int h[Nmax];
int l[Nmax],r[Nmax];
int main()
{
    //freopen("a.inp","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m,d,s=0;
    cin>>n>>m>>d;
    int id=0,dem=0;
    for (int i=1; i<=m; i++)
    {
        cin>>h[i];
        s=s+h[i];
    }
    if (s+(m+1)*d-m<n)
        cout<<"NO";
    else
    {
        cout<<"YES"<<"\n";
        while (n>0)
        {
            int man=min(n-s+1,d);
            id++;s=s-h[id];
            n=n-man-h[id]+1;
            l[id]=dem+man;
            r[id]=dem+man+h[id]-1;
            dem=dem+man+h[id]-1;
        }
    }
    int id1=1;
    for (int i=1;i<=dem;i++)
    {
        if (i<l[id1]) cout<<"0"<<" ";
        else
        if (i==r[id1])
        {
            cout<<id1<<" ";
            id1++;
        }
        else cout<<id1<<" ";
    }
    return 0;
}