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