Wolves appear on the road where Yeongseon is standing, so she is working out carefully where they can be.
The road is divided into N sections numbered 0 through N−1. A section holds at most one wolf.
Yeongseon knows M pieces of information about the wolves. Each piece is a single interval, and it means that at least one section inside that interval holds a wolf.
Write a program that counts the wolf placements satisfying all M pieces of information. Two placements are different when the set of sections holding a wolf is different.