#include <bits/stdc++.h>
#pragma GCC optimize(2)
int n, m, MOD, dp[505][505], C[505][505], a[505];
char s[505];
int main() {
  scanf("%d%d%d", &n, &m, &MOD);
  for (int i = 1; i <= m; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= n; j++) {
      a[j] += s[j] - '0';
    }
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1)
      cnt1++;
    else if (a[i] == 0)
      cnt2++;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= i; j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
    }
  dp[cnt1][cnt2] = 1;
  for (int i = m + 1; i <= n; i++) {
    for (int j = 0; j <= cnt2; j++) {
      int c2 = j, c1 = 2 * (n - i + 1) - c2 * 2;
      if (c1 < 0 || c1 > n) continue;
      if (c2 >= 2)
        dp[c1 + 2][c2 - 2] =
            (dp[c1 + 2][c2 - 2] + 1LL * dp[c1][c2] * C[c2][2] % MOD) % MOD;
      if (c2 >= 1)
        dp[c1][c2 - 1] =
            (dp[c1][c2 - 1] + 1LL * dp[c1][c2] * C[c2][1] * C[c1][1] % MOD) %
            MOD;
      if (c1 >= 2)
        dp[c1 - 2][c2] =
            (dp[c1 - 2][c2] + 1LL * dp[c1][c2] * C[c1][2] % MOD) % MOD;
    }
  }
  printf("%d\n", dp[0][0]);
  return 0;
}
