Problem Statement  
There are N cities in a country, numbered 0 to N1. Each pair of cities is connected by a bidirectional road.
John plans to travel through the country using the following rules:
Return the number of paths he can choose, modulo 1,000,000,007.  
Definition  
 
Constraints  
  roads will contain between 2 and 50 elements, inclusive.  
  Each element of roads will contain n characters, where n is the number of elements in roads.  
  Each character in roads will be 'Y' or 'N'.  
  The ith character in the ith element of roads will be 'N'.  
  The jth character in the ith element of roads and the ith character in the jth element of roads will be equal.  
Examples  
0)  
 
1)  
 
2)  
 
3)  
