#include <bits/stdc++.h>
using namespace std;
int d2x[] = {1, -1, 0, 0, 1, -1, 1, -1};
int d2y[] = {0, 0, 1, -1, 1, -1, -1, 1};
int d3x[] = {1, -1, 0, 0, 0, 0};
int d3y[] = {0, 0, 1, -1, 0, 0};
int d3z[] = {0, 0, 0, 0, 1, -1};
struct edge {
  int from, to, w;
  edge(int from, int to, int w) : from(from), to(to), w(w) {}
  bool operator<(const edge& e) const { return w > e.w; }
};
const double EPS = (1e-9);
bool visited[200];
int n, m, t, cnt;
long long res = 1LL;
vector<string> data;
string temp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    data.push_back(temp);
  }
  for (int i = 0; i < m; i++) {
    memset(visited, 0, sizeof(visited));
    cnt = 0;
    for (int j = 0; j < n; j++) {
      if (!visited[data[j][i]]) {
        ++cnt;
        visited[data[j][i]] = true;
      }
    }
    res *= cnt;
    res = res % 1000000007;
  }
  cout << res;
  return 0;
}
