Presents
One day Kich decided to make a present to Poch for the new year. Kich has prepared bags of gifts, each bag contains gifts of various kinds. Poch has a list in his head of his favorite kinds of gifts. Initially, it is empty. There are requests of two kinds:
Poch likes a gift of type .
Poch disliked gift .
After each change of the list, Kich is equally likely to choose one of the bags, and after each change of the list, Kich is equally likely to take out one gift from all the gifts in the bag. Then Kich puts the gift back into the bag. Find the probability that Kich takes out one of Poch's favorite items.
Input
The first line contains two non-negative integers and — the number of bags and the number of requests.
The next lines contain a non-negative integer — the number of gifts in the bag, and non-negative integers — numbered types of gifts.
The next lines describe the queries:
For a query of the first type: the number 1 and the number — the kind of gift that Poch liked.
For the second type of query: the number 2 and the number — the type of gift that Poch disliked.
It is guaranteed that Pochu will not dislike a gift he disliked before the request, nor will he start liking a gift he already liked.
The sum over does not exceed .
Output
Print lines: in line print the chance that Poch gets one of his favorite gifts, taken modulo . Since the answer can always be represented as an irreducible fraction , where , we ask you to output .