#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 10;
long long dp[maxn][maxn];
long long n, m, mod;
int a[maxn];
char s[maxn];
int main() {
  while (scanf("%I64d%I64d%I64d", &n, &m, &mod) != EOF) {
    memset(a, 0, sizeof(a));
    for (long long i = 1; i <= m; i++) {
      scanf("%s", s);
      for (long long j = 0; j < n; j++) {
        if (s[j] == '1') a[j + 1]++;
      }
    }
    int w = 0, e = 0;
    for (int i = 1; i <= n; i++)
      if (a[i] == 1)
        w++;
      else if (a[i] == 0)
        e++;
    memset(dp, 0, sizeof(dp));
    dp[e][w] = 1;
    for (long long i = 500; i >= 0; i--) {
      for (long long j = 500; j >= 0; j--) {
        if (i >= 2)
          dp[i - 2][j + 2] =
              (dp[i - 2][j + 2] + dp[i][j] * ((i * (i - 1)) / 2)) % mod;
        if (i >= 1) dp[i - 1][j] = (dp[i - 1][j] + dp[i][j] * (i * j)) % mod;
        if (j >= 2)
          dp[i][j - 2] = (dp[i][j - 2] + dp[i][j] * ((j * (j - 1)) / 2)) % mod;
      }
    }
    printf("%I64d\n", dp[0][0]);
  }
  return 0;
}
