3884.Jabber ID

Time Limit: 1s Memory Limit: 256MB

Jabber ID on the national Berland service «Babber» has a form \lt username \gt @ \lt hostname \gt [/resource], where
\lt username \gt - is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters «», the length of \lt username \gt is between 1 and 16, inclusive. \lt hostname \gt - is a sequence of word separated by periods (characters «.»), where each word should contain only characters allowed for \lt username \gt , the length of each word is between 1 and 16, inclusive. The length of \lt hostname \gt is between 1 and 32, inclusive. \lt resource \gt - is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters «», the length of \lt resource \gt is between 1 and 16, inclusive.
The content of square brackets is optional - it can be present or can be absent.

There are the samples of correct Jabber IDs: mike@codeforces.com, 007@en.codeforces.com/contest.

Your task is to write program which checks if given string is a correct Jabber ID.

Input Format(From the terminal/stdin)

The input contains of a single line. The line has the length between 1 and 100 characters, inclusive. Each characters has ASCII-code between 33 and 127, inclusive.

Output Format(To the terminal/stdout)

Print YES or NO.

Sample Input 1

Copy
mike@codeforces.com
                   \n

Sample Output 1

Copy
YES
   \n

Sample Input 2

Copy
john.smith@codeforces.ru/contest.icpc/12
                                        \n

Sample Output 2

Copy
NO
  \n

Submit

请先 登录

© 2025 FAQs