#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 12;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<char>> a(n);
  for (int i = 0; i < n; i++) {
    a[i].resize(m);
    for (int j = 0; j < m; j++) cin >> a[i][j];
  }
  long long res = 1;
  for (int i = 0; i < m; i++) {
    set<char> c;
    for (int j = 0; j < n; j++) {
      c.insert(a[j][i]);
    }
    res = (res * (int)c.size()) % MOD;
  }
  cout << res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
