#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MAXN = 505;
const int MOD = 1e9 + 7;
const int MOD1 = 1e9 + 35011;
const int MOD2 = 1e9 + 18169;
const int INF = (1 << 30);
const long long INFl = 1e18;
int n, m, mod;
int col[MAXN];
long long dp[2][MAXN][MAXN];
char s[MAXN];
int main() {
  cin >> n >> m >> mod;
  for (int i = 0; i < m; ++i) {
    cin >> s;
    for (size_t ptr = 0; ptr < n; ++ptr) {
      if (s[ptr] == '1') col[ptr]++;
    }
  }
  int one = 0, zero = 0;
  for (int i = 0; i < n; ++i) {
    if (col[i] == 0) zero++;
    if (col[i] == 1) one++;
  }
  dp[0][zero][one] = 1;
  for (int iter = m; iter < n; ++iter) {
    for (zero = 0; zero < MAXN; ++zero)
      for (one = 0; one < MAXN; ++one) {
        if (!dp[0][zero][one]) continue;
        if (zero > 1) {
          dp[1][zero - 2][one + 2] += (dp[0][zero][one] * (long long)zero *
                                       (long long)(zero - 1) / 2LL) %
                                      mod;
          dp[1][zero - 2][one + 2] %= mod;
        }
        if (zero && one) {
          dp[1][zero - 1][one] +=
              (dp[0][zero][one] * (long long)zero * (long long)one) % mod;
          dp[1][zero - 1][one] %= mod;
        }
        if (one > 1) {
          dp[1][zero][one - 2] +=
              (dp[0][zero][one] * (long long)one * (long long)(one - 1) / 2LL) %
              mod;
          dp[1][zero][one - 2] %= mod;
        }
        dp[0][zero][one] = 0;
      }
    swap(dp[0], dp[1]);
  }
  printf("%d\n", dp[0][0][0]);
  return 0;
}
