#include <bits/stdc++.h>
using namespace std;
const int N = 508;
int n, m, i, j, mod, a[3], dp[2][N][N];
int z, y, p, q, cnt, k;
long long x;
char s[N][N];
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  for (i = 0; i < m; i++) scanf("%s", &s[i]);
  for (j = 0; j < n; j++) {
    cnt = 0;
    for (i = 0; i < m; i++) cnt += (s[i][j] == '1');
    a[cnt]++;
  }
  dp[0][a[0]][a[1]] = 1;
  q = p = 0;
  for (i = n; i >= 0; i--)
    for (j = n; j >= 0; j--) {
      x = (long long)i * (i - 1) / 2;
      x = (x * dp[p][i][j]) % mod;
      if (i >= 2) dp[q][i - 2][j + 2] = (dp[q][i - 2][j + 2] + x) % mod;
      x = (long long)j * (j - 1) / 2;
      x = (x * dp[p][i][j]) % mod;
      if (j >= 2) dp[q][i][j - 2] = (dp[q][i][j - 2] + x) % mod;
      x = (long long)i * j;
      x = (x * dp[p][i][j]) % mod;
      if (i >= 1 && j >= 1) dp[q][i - 1][j] = (dp[q][i - 1][j] + x) % mod;
    }
  printf("%d\n", dp[q][0][0]);
  return 0;
}
