For test:
```
A roza upala na lapu azora
Upala na Lapu
Roza u pala nala puazora
A roza upala na palu
```
correct answer is:
```
YES
YES
NO
```
but your solution prints:
```
YES
YES
YES
YES
YES
YES
YES
YES
```