f | import re | f | import re |
t | line = input() | t | s = input() |
| regexnum = re.compile('^((-)?(\\%0b[01]{1,20}|\\%0o[0-7]{1,8}|\\%0x[0-9a | | r1 = re.compile('(-?[1-9][\\d]*|-?%0x[1-9a-f][0-9a-f]{0,15}|-?%0o[1-7][0 |
| -f]{1,16}|[1-9][0-9]*|0))$') | | -7]{0,7}|-?%0b[1][0-1]{0,19})(.[0]*([1-9][\\d]*|%0x[1-9a-f][0-9a-f]{0,15 |
| | | }|%0o[1-7][0-7]{0,7}|%0b[1][0-1]{0,19}))?E((\\+|\\-)([1-9][\\d]*|%0x[1-9 |
| | | a-f][0-9a-f]{0,15}|%0o[1-7][0-7]{0,7}|%0b[1][0-1]{0,19}))?') |
| regexexnum = re.compile('^((-)?(\\%0b[01]{1,20}|\\%0o[0-7]{1,8}|\\%0x[0- | | r2 = re.compile('-?[1-9][\\d]*|-?%0x[1-9a-f][0-9a-f]{0,15}|-?%0o[1-7][0- |
| 9a-f]{1,16}|[1-9][0-9]*|0))((\\.)(0*)?(\\%0b[01]{1,20}|\\%0o[0-7]{1,8}|\ | | 7]{0,7}|-?%0b[1][0-1]{0,19}') |
| \%0x[0-9a-f]{1,16}|[1-9][0-9]*|0))?(E)(([-+]){1}(\\%0b[01]{1,20}|\\%0o[0 | | |
| -7]{1,8}|\\%0x[0-9a-f]{1,16}|[1-9][0-9]*|0))?$') | | |
| if regexnum.match(line) or regexexnum.match(line): | | if r1.fullmatch(s) or r2.fullmatch(s): |
| print('YES') | | print('YES') |
| else: | | else: |
| print('NO') | | print('NO') |