#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, m, mod;
char ch[N];
int cnt[N];
long long p[N];
long long f[2][N][N];
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  for (int i = 2; i <= n; ++i) p[i] = 1ll * i * (i - 1) / 2;
  for (int i = 1; i <= m; ++i) {
    scanf("%s", ch + 1);
    for (int j = 1; j <= n; ++j) {
      if (ch[j] == '1') cnt[j]++;
    }
  }
  int x = 0, y = 0;
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] == 0) x++;
    if (cnt[i] == 1) y++;
  }
  f[0][x][y] = 1;
  int cur = 0;
  for (int i = m + 1; i <= n; ++i) {
    cur ^= 1;
    memset(f[cur], 0, sizeof(f[cur]));
    for (int j = 0; j <= n; ++j) {
      int k = 2 * (n - i + 1) - 2 * j;
      if (j >= 2) (f[cur][j - 2][k + 2] += f[cur ^ 1][j][k] * p[j]) %= mod;
      if (j + 2 <= n) (f[cur][j][k - 2] += f[cur ^ 1][j][k] * p[k]) %= mod;
      if (j >= 1 && j < n)
        (f[cur][j - 1][k] += f[cur ^ 1][j][k] * j * k) %= mod;
    }
  }
  cout << f[cur][0][0] % mod;
  return 0;
}
