#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<string> v;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  long long ans = 1;
  for (long long j = 0; j < m; j++) {
    set<long long> s;
    for (long long i = 0; i < v.size(); i++) {
      s.insert(v[i][j]);
    }
    long long diff = s.size();
    ans = ((ans * diff) + 1000000007) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
