SP6978 PERMPATT - Check 1324

Description

Given a permutation P\[1...n\] of {1,2,...n}, you should output if the permutation contains a pattern of the form 1324. That is, do there exist indices 1

Input Format

First line contains T, the number of test cases Each of the next T lines contains **n** (1

Output Format

Output T lines, one per test case: "yes"(without quotes) if the permutation contains a 1324 pattern or "no" (without quotes) otherwise. **Warning:** Huge I/O