You are given N input string, and you have to validate whether they are valid Roman numeral or not.
If it is valid, print "YES". Otherwise, print "NO". Try to create a regular expression for a valid Roman numeral.
Know more about Roman numeral here
1 <= N <= 10
The number will be between 1 and 3999 (both included).
First line contains an integer N, the number of inputs.
N lines follow, each containing some string.
For every string listed, print "YES" if it is a valid roman numeral and "NO" if it is not on separate lines. Do not print the quotes.
3 CDXXI M IIX
YES YES NO