#include <bits/stdc++.h>
using namespace std;
const long long o = 501;
long long n, m, mod, f[o][o], l, r;
char c[o][o];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> mod;
  for (long long i = 1; i <= m; i++) cin >> c[i] + 1;
  for (long long i = 1; i <= n; i++) {
    long long x = 0;
    for (long long j = 1; j <= m; j++)
      if (c[j][i] == '1') x++;
    if (!x)
      l++;
    else if (x == 1)
      r++;
  }
  f[l][r] = 1;
  for (long long i = m + 1; i <= n; i++)
    for (long long j = 0; j <= n; j++) {
      long long k = n - i + 1 - j << 1;
      if (k > n || k < 0) continue;
      if (j > 1)
        f[j - 2][k + 2] =
            (f[j - 2][k + 2] + j * (j - 1) / 2 * f[j][k] % mod) % mod;
      if (k > 1)
        f[j][k - 2] = (f[j][k - 2] + k * (k - 1) / 2 * f[j][k] % mod) % mod;
      if (j && k) f[j - 1][k] = (f[j - 1][k] + j * k * f[j][k] % mod) % mod;
    }
  cout << f[0][0];
  return 0;
}
