Advertisement
gruslan

Artur_2

Apr 18th, 2023 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. input()
  2. word = input().replace('?', '#').replace('*', '#')
  3. i = word.index('X')
  4.  
  5. if word[-1] == '.':
  6.     if set(word[i + 1:]) == {'.'}:
  7.         if word[:i].find('.') < word[:i].rfind('#'):
  8.             print('YES')
  9.         else:
  10.             print('NO')
  11.     else:
  12.         if '#' in word[i + 1:]:
  13.             print('YES')
  14.         else:
  15.             print('NO')
  16. else:
  17.     print('NO')
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement