#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cerr << #a << " = " << a << endl;
 
template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
 
const double PI = acos(-1.0);
const int INF = 1e9 + 47;
const LL LINF = 1LL * INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


int bad[1<< 18];
double K[1 << 18], B[1 << 18];

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, m, k;
	cin >> n >> m >> k;
	FOR(i, 0, k)
	{
		int x;
		cin >> x;
		bad[x] = 1;
	}
	int cnt = 0;
	FOR(i, 0, n + 1)
	{
		if(bad[i])
			cnt++;
		else
		{
			if(cnt >= m)
			{
				cout << "-1" << endl;
				return 0;
			}
			cnt = 0;
		}
	}
	FOR(i, 0, m)
	{
		K[n + i] = 0;
		B[n + i] = 0;
	}
	double M = m;
	double sumK = 0, sumB = 0;
	RFOR(i, n, 0)
	{
		if(bad[i])
		{
			K[i] = 1;
			B[i] = 0;
		}
		else
		{
			K[i] = sumK / M;
			B[i] = 1 + (sumB / M);
		}
		sumK += K[i] - K[i + m];
		sumB += B[i] - B[i + m];
		//cout << K[i] << " " << B[i] << endl;
	}
	cout << fixed << setprecision(8) << B[0] / (1.0 - K[0]) << endl;
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}
 

#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>

using namespace std;

int main(){
    string str;
    cin >> str;
    long nLen = str.length();    
    long m;
    cin >> m;
    if(nLen == 1){
        long nAns = long(str[0] - '0');
        if(nAns <= m){
            cout << "1" << endl;
        } else {
            cout << "0" << endl;
        }
        return 0;
    }
  
    long d = 0;
    vector<long> viNum(nLen);
    for(long i = 0; i < nLen; i++){
        viNum[i] = long(str[i]-'0');
        d = max(d, viNum[i]+1);
    }

    long iOK = 0, iNG = m+1;
    while(iNG - iOK > 1){
        long iThis = (iNG + iOK)/2;
        long nSum = viNum[0];
        bool b = true;
        for(long i = 1; i < nLen; i++){
            if(m / iThis < nSum){
                b = false;
                break;
            }
            nSum *= iThis;
            nSum += viNum[i];
        }
        if(b && nSum <= m){
            iOK = iThis;
        } else {
            iNG = iThis;
        }
    }
    
    cout << max(iOK-d+1, 0L) << endl;
    
    return 0;
}
