#616
Unrated
Problem Setting
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Note: The memory limit for this problem is 512MB, twice the default.

Farmer John created NN (1N1051\le N\le 10^5) problems. He then recruited MM (1M201\le M\le 20) test-solvers, each of which rated every problem as "easy" or "hard."

His goal is now to create a problemset arranged in increasing order of difficulty, consisting of some subset of his NN problems arranged in some order. There must exist no pair of problems such that some test-solver thinks the problem later in the order is easy but the problem earlier in the order is hard.

Count the number of distinct nonempty problemsets he can form, modulo 109+710^9+7.

입력

The first line contains NN and MM.

The next MM lines each contain a string of length NN. The iith character of this string is E if the test-solver thinks the iith problem is easy, or H otherwise.

출력

The number of distinct problemsets FJ can form, modulo 109+710^9+7.

예제 입력 1

3 1
EHE

예제 출력 1

9

예제 입력 2

10 6
EHEEEHHEEH
EHHHEEHHHE
EHEHEHEEHH
HEHEEEHEEE
HHEEHEEEHE
EHHEEEEEHE

예제 출력 2

33

점수

Inputs 3-4: M=1M=1Inputs 5-14: M16M\le 16Inputs 15-22: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.