#include <bits/stdc++.h>
using namespace std;
long long a[505], ans, i, k, j, n, m, mod, a0, a1, a2, f[505][505];
char s[505];
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  for (i = 1; i <= m; i++) {
    scanf("%s", s);
    for (j = 0; j < n; j++)
      if (s[j] == '1') a[j]++;
  }
  ans = 1;
  for (i = 0; i < n; i++) {
    if (a[i] == 0) a0++;
    if (a[i] == 1) a1++;
    if (a[i] == 2) a2++;
  }
  f[a0][a1] = 1;
  for (j = n; j >= 0; j--)
    for (k = n; k >= 0; k--) {
      if (j > 1) f[j - 2][k + 2] += f[j][k] * (j - 1) * j / 2 % mod;
      if (j > 0) f[j - 1][k] += f[j][k] * j * k % mod;
      if (k > 1) f[j][k - 2] += f[j][k] * k * (k - 1) / 2 % mod;
    }
  printf("%I64d\n", f[0][0] % mod);
  return 0;
}
