#include <bits/stdc++.h>
using namespace std;
long long int n, m, mod;
string s;
long long int dp[505][505];
long long int recur(long long int i, long long int o, long long int s) {
  long long int t = s - o;
  if (i > n) return 1;
  long long int an = 0;
  if (dp[i][o] != -1) return dp[i][o];
  if (t > 1) an = (an + recur(i + 1, o + 2, s) * ((t * (t - 1)) / 2)) % mod;
  if (o > 1) an = (an + recur(i + 1, o - 2, s - 2) * ((o * (o - 1)) / 2)) % mod;
  if (o > 0 && t > 0) an = (an + recur(i + 1, o, s - 1) * (o * t)) % mod;
  return dp[i][o] = an;
}
int main() {
  memset(dp, -1, sizeof dp);
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> mod;
  long long int o[505] = {0}, t[505] = {1};
  for (int i = 1; i <= n; i++) t[i] = 1, o[i] = 0;
  for (int i = 1; i <= m; i++) {
    cin >> s;
    for (int j = 1; j <= n; j++)
      if (s[j - 1] == '1') {
        if (t[j])
          t[j]--, o[j]++;
        else
          o[j]--;
      }
  }
  long long int one = 0, two = 0;
  for (int i = 1; i <= n; i++) {
    one += o[i];
    two += t[i];
  }
  printf("%lld\n", recur(m + 1, one, one + two));
  return 0;
}
