_One day, Haitang found that Ava would not hold live streaming anymore._
Ava would say an opening statement at the beginning of the live streaming.
The conditions for a valid opening statement are as follows:
- An empty string is a valid opening statement.
- If
S is a valid opening statement, then
S+ava and
ava+S are also valid opening statements.
- If
S is a valid opening statement, then
S+avava and
avava+S are also valid opening statements.
- Any string that cannot be constructed using the above methods is not a valid opening statement.
Given a string
S, you need to determine if it is a valid opening statement.