#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    int N;
    cin >> N;
    string S, T;
    cin >> S >> T;
    int c = 0, d = 0;
    for (int i = 0; i < N; i++) {
        if(S[i] == '0') c++;
        if(T[i] == '0') d++;
    }
    if(c != d){
        cout << -1 << endl;
        return 0;
    }
    vector<int> A(c), B(c);
    c = 0; d = 0;
    for (int i = 0; i < N; i++) {
        if(S[i] == '0'){
            A[c] = i;
            c++;
        }
        if(T[i] == '0'){
            B[d] = i;
            d++;
        }
    }
    int ans = A.size();
    for (int i = 0; i < A.size(); i++) {
        if(A[i] == B[i]) ans--;
    }
    cout << ans << endl;

}
#include <bits/stdc++.h>
using namespace std;
#define REPP(i,a,b,d) for(int i=(a);i<=(int)(b);i+=(d))
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=(a);i>=(int)(b);i-=(d))
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) for(int i=0; i<(int)(a); i++)
#define FORD(i,a) for(int i=(int)(a)-1; i>=0; i--)
#define pb push_back
typedef long long ll;

const int N = 1e5+5, K = 15;
int n, m, k;
bool trap[N];
pair<long double, long double> E[2*N];

void no() {
	cout << -1 << '\n';
	exit(0);
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n >> m >> k;
	FOR(i, k) {
		int x; cin >> x;
		trap[x] = 1;
	}
	int cnt = 0;
	REP(i, 1, m) cnt += trap[i];
	if(cnt == m) no();
	REP(i, m+1, n) {
		cnt += trap[i] - trap[i-m];
		if(cnt == m) no();
	}

	REP(i, n, n+m-1) E[i] = {0, 0};

	pair<long double, long double> acc = {0, 0};
	REV(i, n-1, 0) {
		if(trap[i]) E[i] = {1, 0};
		else {
			E[i].first += acc.first / (long double)m;
			E[i].second += acc.second / (long double)m;
			E[i].second++;
		}
		acc.first += E[i].first, acc.second += E[i].second;
		acc.first -= E[i+m].first, acc.second -= E[i+m].second;
	}

	cout << fixed << setprecision(4) << -E[0].second / (E[0].first-1) << '\n';

	return 0;
}