Vishesh, who doesn't like maths, has to certify v-shaped tracks. A track is valid if it satisfies the following conditions :

1. There must be a constant difference between the height of pillars (not zero) of a track. For eg., if the heights of first two pillars are 7 and 5, then height of 3rd pillar must be 3. As 7-5=2 & 5-3=2.

2. The height of middle pillar must be always 1.

3. Number of pillars on the left side must be equal to the number of pillars on the right side of middle pillar. And their heights must be also equal. for example: Track with pillar heights [3 2 1 2 3] is a valid track.

Help him in finding the valid tracks.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains an Integer N denoting number of pillars and the second line contains N space separated integers which are the heights of pillar.

**Output:**

Print on the new line "Yes" if it is a valid v-shaped track. Otherwise, print "No".

**Constraints:**

1<=T<=100

3<=N<=10^{6}

1<=H[i]<=10^{6}

**Example:
Input:**

2

3

2 1 2

5

4 3 2 3 4

Yes

No

Author: arun03

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.

vamsikrishna55 | 122 |

UrGuru | 117 |

Vagesh Verma | 112 |

chaolinyu | 96 |

Akhil varma | 93 |

abducodes | 634 |

harshtyagi36 | 302 |

highway_to_hell | 252 |

rajeswarii | 248 |

Akhil varma | 246 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.