Encoded Strings
Practice
3.9 (79 votes)
Ad Hoc
Basic programming
Open
Approved
Easy
Problem
75% Success 10359 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are given a string S, consisting of only lowercase Latin letters and the string is encoded. Each letters has numerical equivalent corresponding to it's position in the Alphabetical order, i.e 'a' corresponds to 1, 'b' corresponds to 2 and so on till 'i' which corresponds to 9.

You have to tell, when the string is decoded into a number by replacing the characters with numbers, if it is divisible by 6.

Input:
The first line contains a string consisting of only Lowercase Latin letters ( 'a'-'i' ).

Output:
Print "YES" (without the quotes) if the decoded number is divisible by 6, "NO" (without the quotes) otherwise.

Constraints:
String will not contain more than 105 characters
1 ≤ |S| ≤ 105

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
1 votes
Tags:
Basic MathBitwise XOR
Points:20
9 votes
Tags:
OpenAlgorithmsApprovedEasyMathamatics
Points:20
17 votes
Tags:
MathematicsBasic MathModular arithmeticMath