#include <bits/stdc++.h>
using namespace std;
int mod;
int n, m;
long long C[510][510];
void Init() {
  C[0][0] = 1;
  for (int i = 1; i <= 500; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) {
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
    }
    for (int j = 0; j <= i; j++) {
      C[i][j] %= mod;
    }
  }
}
char str[10010];
int num[510];
long long dp[510][510];
int main() {
  while (scanf("%d%d%d", &n, &m, &mod) != EOF) {
    bool fg = 1;
    Init();
    for (int i = 1; i <= m; i++) {
      scanf("%s", str);
      int one = 0;
      for (int j = 0; j < n; j++) {
        if (str[j] == '1') {
          one++;
          num[j]++;
          if (num[j] > 2) {
            fg = 0;
          }
        }
      }
      if (one != 2) {
        fg = 0;
      }
    }
    if (!fg) {
      puts("0");
      continue;
    }
    int two = 0, one = 0;
    for (int i = 0; i < n; i++) {
      if (num[i] == 0) {
        two += 1;
      } else if (num[i] == 1) {
        one += 1;
      }
    }
    memset(dp, 0, sizeof(dp));
    dp[n - m][0] = 1;
    int tot = (n - m) * 2;
    while (one--) {
      for (int i = 0; i <= 500; i++) {
        int j = tot - (i * 2);
        if (dp[i][j]) {
          if (i - 1 >= 0) {
            dp[i - 1][j + 1] =
                (dp[i - 1][j + 1] + dp[i][j] * C[i][1] % mod) % mod;
          }
          if (j - 1 >= 0) {
            dp[i][j - 1] = (dp[i][j - 1] + dp[i][j] * C[j][1] % mod) % mod;
          }
        }
      }
      tot--;
    }
    while (two--) {
      for (int i = 0; i <= 500; i++) {
        int j = tot - (i * 2);
        if (dp[i][j]) {
          if (i - 2 >= 0) {
            dp[i - 2][j + 2] =
                (dp[i - 2][j + 2] + dp[i][j] * C[i][2] % mod) % mod;
          }
          if (j - 2 >= 0) {
            dp[i][j - 2] = (dp[i][j - 2] + dp[i][j] * C[j][2] % mod) % mod;
          }
          if (i - 1 >= 0 && j - 1 >= 0) {
            dp[i - 1][j] =
                (dp[i - 1][j] + dp[i][j] * C[i][1] % mod * C[j][1] % mod) % mod;
          }
        }
      }
      tot -= 2;
    }
    cout << dp[0][0] << endl;
  }
  return 0;
}
