#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5;
const double eps = 1e-6;
int send[maxn];
double k[maxn], b[maxn], sumk = 0.0, sumb = 0.0;
int main() {
    int N, M, K;
    scanf("%d %d %d", &N, &M, &K);
    int x;
    for (int i = 0; i < K; i++) {
        scanf("%d", &x);
        send[x] = 1;
    }
    for (int i = N - 1; i >= 0; i--) {
        if (send[i]) {
            k[i] = 1;
            b[i] = 0;
        }
        else {
            k[i] = sumk / M;
            b[i] = sumb / M + 1;
        }
        sumk -= k[i + M];
        sumk += k[i];
        sumb -= b[i + M];
        sumb += b[i];
    }
    if (fabs(k[0] - 1.0) <= eps) {
        printf("-1\n");
    }
    else {
        printf("%.4f\n", b[0] / (1.0 - k[0]));
    }
    return 0;
}
#include <bits/stdc++.h>
#define rep(i,l,r) for (int i=(l);i<=(r);++i)
#define per(i,r,l) for (int i=(r);i>=(l);--i)
#define mp make_pair
#define fi first
#define se second
#define ll long long
using namespace std;
int fpw(int x,int y,int p){
	int s=1; for (;y;y>>=1,x=(ll)x*x%p) if (y&1) s=(ll)s*x%p;
	return s;
}
int main(){
	int a,b,c; cin>>a>>b>>c;
	int pw;
	if (b==1||c==1&&b<=4||c==2&&b<=2) pw=fpw(b,c,4);
	else pw=fpw(b,c,4)+4;
	cout<<fpw(a,pw,10)<<endl;
	return 0;
}