One day little Vasya found mom's pocket book. The book had *n* names of her friends and unusually enough, each name was exactly *m* letters long. Let's number the names from 1 to *n* in the order in which they are written.

As mom wasn't home, Vasya decided to play with names: he chose three integers *i*, *j*, *k* (1 ≤ *i* &lt; *j* ≤ *n*, 1 ≤ *k* ≤ *m*), then he took names number *i* and *j* and swapped their prefixes of length *k*. For example, if we take names "CBDAD" and "AABRD" and swap their prefixes with the length of 3, the result will be names "AABAD" and "CBDRD".

You wonder how many different names Vasya can write instead of name number 1, if Vasya is allowed to perform any number of the described actions. As Vasya performs each action, he chooses numbers *i*, *j*, *k* independently from the previous moves and his choice is based entirely on his will. The sought number can be very large, so you should only find it modulo 1000000007 (10<sup class="upper-index">9</sup> + 7).
The first input line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 100) — the number of names and the length of each name, correspondingly. Then *n* lines contain names, each name consists of exactly *m* uppercase Latin letters.
2 3
AAB
BAA
4
4 5
ABABA
BCGDG
AAAAA
YABSA
216
1 1
E
1
2 2
NS
PD
4
3 4
PJKD
NFJX
FGFK
81
4 5
SXFMY
ATHLM
KDDQW
ZWGDS
1024
20 14
JNFKBBBJYZHWQE
LBOKZCPFNKDBJY
XKNWGHQHIOXUPF
DDNRUKVUGHWMXW
MTIZFNAAFEAPHX
IXBQOOHEULZYHU
MRCSREUEOOMUUN
HJTSQWKUFYZDQU
GMCMUZCOPRVEIQ
XBKKGGJECOBLTH
XXHTLXCNJZJUAF
VLJRKXXXWMTPKZ
PTYMNPTBBCWKAD
QYJGOBUBHMEDYE
GTKUUVVNKAHTUI
ZNKXYZPCYLBZFP
QCBLJTRMBDWNNE
TDOKJOBKEOVNLZ
FKZUITYAFJOQIM
UWQNSGLXEEIRWF
515139391
5 14
AQRXUQQNSKZPGC
DTTKSPFGGVCLPT
VLZQWWESCHDTAZ
COKOWDWDRUOMHP
XDTRBIZTTCIDGS
124999979
9 23
OILBYKHRGMPENVFNHLSIUOW
LPJFHTUQUINAALRDGLSQUXR
LYYJJEBNZATAF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
A
A
A
A
A
A
A
A
A
A
A
A
A
A
1
100 1
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
2
100 1
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
C
D
E
F
G
H
I
J
K
L
M
N
A
B
14
100 1
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
26
from heapq import heapify, heappop, heappush, nlargest
from collections import Counter, defaultdict
from sys import stdin, stdout
from math import ceil, floor, sqrt
from functools import reduce,lru_cache
# n,m = map(int,stdin.readline().split())
# stdout.write(str(arr[x-y]-arr[x])+'\n')
# reps = int(input())
# for _ in range(reps):
#     n,m = map(int,stdin.readline().split())
    # s1,s2 = stdin.readline().strip().split()
    # s2 = stdin.readline().strip()
    # n = int(stdin.readline())
    # arr = list(map(int,stdin.readline().split()))
    # arr.sort()
    
n,m = map(int,input().split())
arr = [set() for _ in range(m)]
for _ in range(n):
    for i,ch in enumerate(stdin.readline().strip()):
        arr[i].add(ch)
        
print(reduce(lambda a,b:a*b ,(len(s) for s in arr)))