#include <bits/stdc++.h>
using namespace std;
long long n, m, mod, mtx[505][505], num[505], dp[505][505];
char a[505];
signed main() {
  scanf("%lld %lld %lld", &n, &m, &mod);
  for (long long i = 1; i <= m; i++) {
    scanf("%s", a + 1);
    for (long long j = 1; j <= n; j++) mtx[i][j] = a[j] - '0';
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) num[i] += mtx[j][i];
  long long s1 = 0, s2 = 0;
  for (long long i = 1; i <= n; i++) {
    if (num[i] == 0) s1++;
    if (num[i] == 1) s2++;
  }
  dp[s1][s2] = 1;
  for (long long i = m + 1; i <= n; i++)
    for (long long s1 = 0; s1 <= n; s1++) {
      long long s2 = (n - i + 1) * 2 - s1 * 2;
      if (s2 < 0 || s2 > n) continue;
      if (s1 >= 2)
        (dp[s1 - 2][s2 + 2] += dp[s1][s2] * s1 * (s1 - 1) / 2) %= mod;
      if (s1 >= 1) (dp[s1 - 1][s2] += dp[s1][s2] * s1 * s2) %= mod;
      if (s2 >= 2) (dp[s1][s2 - 2] += dp[s1][s2] * s2 * (s2 - 1) / 2) %= mod;
    }
  printf("%lld\n", dp[0][0] % mod);
  return 0;
}
