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

#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()
#define ff first
#define ss second

const double pi=3.1415926535897932384626433832795;
const int inf=1e9;
const ll inf2=1e18;
const int mod=1e9+7;

void boost(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

void solve(){
	int n,m,k;
	cin>>n>>m>>k;
	vector<bool> mark(n+1,false);
	int x;
	fr(i,0,k){
		cin>>x;
		mark[x]=true;
	}
	x=0;
	fr(i,0,n+1){
		if(mark[i])
			x++;
		else
			x=0;
		if(x>=m){
			cout<<-1;
			return;
		}
	}
	vector<ld> val(n+1,0),coeff(n+1,0);
	ld curval=0,curc=0;
	for(int i=n-1;i>=0;i--){
		if(i+m+1<n){
			curval-=val[i+m+1];
			curc-=coeff[i+m+1];
		}
		curc+=coeff[i+1];
		curval+=val[i+1];
		if(mark[i]){
			coeff[i]=1;
			continue;
		}
		val[i]=(curval)/(1.0*m) +1.0;
		coeff[i]=curc/(1.0*m);
	}
	ld y=1.0-coeff[0];
	ld ans=(val[0]/y);
	cout<<fixed<<setprecision(5)<<ans<<endl;
	return;
}

int main()
{
	boost();
	
	int tc=1;
	//cin>>tc;
	while(tc--)
		solve();
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)

#define LOCAL 1;
#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define dbg(x) true
#endif

template<typename T>
ostream& operator<< (ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last)
      out << ", ";
  }
  out << "]";
  return out;
}

template<typename F, typename S>
ostream& operator<< (ostream& out, const pair<F,S>& p) {
  out << "[" << p.first << ", " << p.second << "]";
  return out;
}

const int mod = 998244353;

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(ll y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(ll n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    ll t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt< mod >;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll h,w,k;cin >> h >> w >> k;
  vector<vector<char>> s(h,vector<char>(w,'.'));
  rep(i,k){
    ll hi,wi;
    char c;
    cin >> hi >> wi >> c;
    hi--;wi--;
    s[hi][wi] = c;
  }
  vector<vector<modint>> dp(h,vector<modint>(w,0));
  dp[0][0] = ((modint) 3).pow(h*w-k);
  modint fac = ((modint)2)/((modint)3);
  rep(hi,h)rep(wi,w){
    if(hi!=h-1){
      if(s[hi][wi]=='D') dp[hi+1][wi]+=dp[hi][wi];
      else if(s[hi][wi]=='X') dp[hi+1][wi]+=dp[hi][wi];
      else if(s[hi][wi]=='.') {
        dp[hi+1][wi]+=fac*dp[hi][wi];
        // dbg(dp[hi][wi]);
        // dbg(fac*dp[hi][wi]);
      }
    }
    if(wi!=w-1){
      if(s[hi][wi]=='R') dp[hi][wi+1]+=dp[hi][wi];
      else if(s[hi][wi]=='X') dp[hi][wi+1]+=dp[hi][wi];
      else if(s[hi][wi]=='.') dp[hi][wi+1]+=fac*dp[hi][wi];
    }    
  }
  // dbg(dp);
  cout << dp[h-1][w-1] << endl;

  
  return 0;
    

}
