Problem Description
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
Problem Constraints
1 <= N <= 10
The number will be between 1 and 3999 (both included).
Input Format
First line contains an integer N, the number of inputs.
N lines follow, each containing some string.
Output Format
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.
Example Input
3 CDXXI M IIX
Example Output
YES YES NO