Jumping Geek
Submissions: 1488   Accuracy:

38.76%

  Difficulty: Basic   Marks: 1

Once there was a Geek he was quite intelligent and was also fond of jumping. But he jumped in a pattern like 1 leap, 2 leap, 3 leap and again from the start after 3rd leap.
1 leap means if Geek is at point P then he will jump to P+1.
2 leap means if Geek is at point P then he will jump to P+2.
3 leap means if Geek is at point P then he will jump to P+3.
You are his friend and more smarter than him. Before he starts jumping you need to tell whether he could land up to a point D or not.
Note:-He starts from point 0.

Input:
First line contains number of test cases denoted by T. The next T lines contains a point D.

Output:
Output "yes" without a quotes if your friend can arrive at point D or "no" without a quotes otherwise.

Constraints:
0<=T<=100
0<=D<=10000000000

Example:
Input
3
0
1
8
Output:
yes
yes
no

** For More Input/Output Examples Use 'Expected Output' option **

Author: Ayush Saluja


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.