#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll r() {
	ll x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c))x=x*10+c-'0',c=getchar();
	return x*f;
}
#define d r()
ll n,cmp;
ll a[200010];
ll b[200010];
vector<ll> e[200010];
ll in[200010];
bool vis[200010];
ll viss[200010];
void dfs(ll u){
	//vis[u]=1;
	if(in[u]==0)cout<<u<<"\n",vis[u]=1;
	for(int i=0;i<e[u].size();i++){
		ll v=e[u][i];
		if(vis[v]||in[v]==0)continue;
		in[v]--;
		dfs(v);
	}
}
int main(){
	n=d;
	f(i,1,n)a[i]=d,b[i]=i-a[i],cmp+=abs(b[i]);
	if(cmp/2>=n){
		cout<<-1;
		return 0;
	}
	f(i,1,n){
		if(b[i]>0){
			ll now=i-1;
			viss[now]++;
			for(int j=i-2;j>=a[i];j--)e[now].push_back(j),in[j]++,viss[j]++,now=j;
		}
		if(b[i]<0){
			ll now=i;
			viss[now]++;
			f(j,i+1,a[i]-1)e[now].push_back(j),viss[j]++,in[j]++,now=j;
		}
	}
//	f(i,1,n-1){
//		for(int j=0;j<e[i].size();j++)cout<<e[i][j]<<" ";
//		cout<<endl; 
//	}
	f(i,1,n-1){
		//cout<<in[i]<<" ";
		if(viss[i]!=2||b[i]==0){
			cout<<-1;
			return 0;
		}
	}
	f(i,1,n-1)if(in[i]==0&&!vis[i])dfs(i);
	return 0;
}

#include<cmath>
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#include<vector>
#include<bitset>
using namespace std;
const int maxn=105;
int n,k,m,a[maxn],sum;
inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
		if(ch=='-')
			f=-1;
		ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
    }
    return x*f;
}
inline void write(int a)
{
    if(a<0)
    {
		char a='-',b='1';
		putchar(a);
		putchar(b);
    }
    else
    {
		if(a>=10)
			write(a/10);
		putchar(a%10+'0');
    }
}

int main()
{
    n=read(),k=read(),m=read();
	for(int i=1;i<n;++i)
		a[i]=read(),sum+=a[i];
	int shu=n*m-sum;
	if(shu>k)
		puts("-1");
	else
		write(max(0,shu));
    return 0;
}
