#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int32_t mod = 1000000007;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  vector<int> pre[n];
  for (auto &x : a) cin >> x;
  long long int ans = 1;
  for (int i = 0; i < m; i++) {
    map<int, int> mp;
    for (int j = 0; j < n; j++) {
      mp[a[j][i]]++;
    }
    int s = mp.size();
    ans = (ans % mod * s % mod) % mod;
  }
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
