#include <bits/stdc++.h>
using namespace std;
int n, m, mod;
int s[1001];
long long A[1001][1001];
long long A_div2[1001][1001];
long long F[501][501];
long long f(int n1, int n2) {
  if (n1 + n2 == 0) return 1;
  long long &ret = F[n1][n2];
  if (ret != -1) return ret;
  ret = 0;
  if (n1 > 0) {
    for (int i = 0; i <= n2; i++) {
      long long val = 1;
      val *= A[n2][i];
      val *= A[n2 + n1 / 2][i + 1];
      val %= mod;
      val *= n1 - 1;
      val %= mod;
      val *= f(n1 - 2, n2 - i);
      ret += val;
      ret %= mod;
    }
  } else {
    for (int i = 2; i <= n2; i++) {
      long long val = 1;
      val *= A[n2 - 1][i - 1];
      val *= A_div2[n2][i];
      val %= mod;
      val *= f(n1, n2 - i);
      ret += val;
      ret %= mod;
    }
  }
  return ret;
}
int MAIN() {
  memset(F, 0xff, sizeof(F));
  cin >> n >> m >> mod;
  for (int i = 0; i <= n; i++) {
    A[i][0] = 1;
    for (int j = 1; j <= i + 1; j++)
      A[i][j] = (A[i][j - 1] * (i - j + 1)) % mod;
    for (int j = 1; j <= i + 1; j++) {
      long long v = 1;
      bool d = false;
      for (int k = 1; k <= j; k++) {
        if (d == false && (i - k + 1) % 2 == 0) {
          v *= (i - k + 1) / 2;
          d = true;
        } else
          v *= (i - k + 1);
        v %= mod;
      }
      A_div2[i][j] = v;
    }
  }
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= m; i++) {
    string S;
    cin >> S;
    S = " " + S;
    for (int j = 1; j <= n; j++)
      if (S[j] == '1') s[j]++;
  }
  bool bad = false;
  int n1 = 0, n2 = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == 0)
      n2++;
    else if (s[i] == 1)
      n1++;
    else if (s[i] > 2)
      bad = true;
  }
  if (bad)
    cout << 0 << endl;
  else {
    cout << f(n1, n2) << endl;
  }
  return 0;
}
int main() {
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}
