SP8333 PLCNMGME - Place-name game

Description

Place-name game is a favourite pastime among the few children that go to school in Dystopia. The game is played as follows : One player says the name of a city and the next player has to say the name of a city that begins with the last letter of the said city. The game then goes on. Dystopian cities recently went through a massive renaming. Now each city has a name that begins with a consonant and ends with a consonant. Anaximander is a student with a very poor knowledge of geography. Hence he fares very poorly in the game. He has recently come up with a new idea. He would just remember the name of 21 Dystopian cities. He wants to choose the 21 cities such that there is exactly one city name starting with each consonant and exactly one city name ending with each. This would give him a good advantage in the game, whether he is playing first or second. Given the names of the N cities in Dystopia, find out the number of ways Anaximander can select 21 city names out of the lot satisfying the properties. As this number can be very large, output it modulo 100000007.

Input Format

The first line of the input contains N (

Output Format

Output modulo 100000007 the number of ways Anaximander can choose 21 city names out of the N with the intended properties.