You found N toy boxes in storage. After looking through them, you found that they contain M different types of toys. The toy types are numbered from 1 to M.
A box may contain several types of toys, and toys of the same type may appear in several different boxes.
Your room is too small to keep every box, so you want to choose some of them. The boxes you choose must contain at least one toy of every type from 1 through M.
Count how many ways there are to choose boxes satisfying this condition. Boxes are considered distinct.
The first line contains the number of boxes N and the number of toy types M. (1 <= N <= 1,000,000, 1 <= M <= 20)
Each of the next N lines describes one box. The first number on the line is K_i, followed by K_i toy type numbers contained in that box. (0 <= K_i <= M)
Toy type numbers are between 1 and M, inclusive.
Print the number of ways to choose boxes so that every toy type appears at least once, modulo 1,000,000,007.