Aditi and Nandi are very good friends and never want to go far from each other. Their friendship is defined in a string of '0' and '1' . Help them to check that they are far from each other or not. There is only one way to check, all 0's should be together, it means they are not far from each other.
First line consists of the test case T. The only line of each test case consists of string , consisting of 0 and 1.
If they are not far from each other print "YES" else "NO".
1<=|Length of string|<=10000
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.