This page is still under construction.

Parts of this page are still being built. What you see may change.

Grades

Interview

Time limit2sMemory limit512 MB

Summary
Given a list of grades, compare the midpoint of the maximum and minimum against the overall average, and report whether they differ by less than 1.
Level

Easy2 of 10

Topics
Array, Math, Implementation
Solved
No attempts yet

Problem

Professor Snape has just finished marking the final exam papers and wants to know whether the distribution of grades is satisfactory.

He first sorted all the papers by grade, then took the highest and the lowest mark and computed their average. Call this number AA. Next he computed the average of all the grades. Call this number BB. He considers the distribution satisfactory if and only if the absolute difference between AA and BB is less than 11.

Write a program that helps Professor Snape.

Input

The first line contains the number of test cases TT.

Each test case consists of two lines. The first line holds a single integer nn, the number of students (1≤n≤500001 \le n \le 50000). The second line holds nn space separated non-negative integers smaller than 101101, the grades the students received.

Output

For each test case print Yes on its own line if the distribution is satisfactory, and No otherwise.

Examples2

  1. Example 1

    Input
    2
    3
    1 2 3
    3
    1 10 100
    
    Expected output
    Yes
    No
    
  2. Example 2

    Input
    2
    4
    0 10 7 7
    4
    0 10 7 6
    
    Expected output
    No
    Yes