Hong Kong Identity card
Difficulty: Basic
Question
The Hong Kong Identity Card consists of 1 English letter and 6 numeric digits. A check digit, which could be 0 to 9 or A, is appended in brackets. It is calculated as follows:
For letters, A is converted to value 1, B to value 2, and so on.
For every HKID number , the sum is .
The check digit c shall be the smallest non-negative integer such that . If c is 10, A is used instead.
Write a program to determine if the Identity Card is valid.
Input Format
A line which consists of the format .
Constraints
Output Format
Output 'YES' if the card is valid, otherwise, output 'NO'.
Sample Inputs:
Last updated