#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ sort(int *, int);
int main(int argc, const char *argv[]) {
  int m, n, i, j, flag, d, card[100];
  scanf("%d", &m);
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &card[i]);
    }
    sort(card, n);
    flag = 1;
    d = card[1] - card[0];
    for (j = 2; j < n; j++) {
      if (card[j] - card[j - 1] != d) {
        flag = 0;
        break;
      }
    }
    if (flag)
      printf("yes\n");
    else
      printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea0(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
je     125f <main+0x12f>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11b8 <main+0x88>
movslq -0x1c(%rbp),%rax
lea    -0x1c0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5b(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1180 <main+0x50>
lea    -0x1c0(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <sort@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x1bc(%rbp),%eax
sub    -0x1c0(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1233 <main+0x103>
movslq -0x20(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
sub    -0x1c0(%rbp,%rcx,4),%eax
cmp    -0x28(%rbp),%eax
je     1220 <main+0xf0>
movl   $0x0,-0x24(%rbp)
jmp    1233 <main+0x103>
jmp    1225 <main+0xf5>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e4 <main+0xb4>
cmpl   $0x0,-0x24(%rbp)
je     124e <main+0x11e>
lea    0xdbf(%rip),%rdi
call   1030 <printf@plt>
jmp    125a <main+0x12a>
lea    0xdb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x29>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
jne    1182 <main+0x52>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10(%rsp),%r14
lea    0xe72(%rip),%r12
lea    0xe71(%rip),%rbp
lea    0x8(%rsp),%r15
jmp    11c3 <main+0x93>
nopl   0x0(%rax)
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x2e2a(%rip),%rcx
cmp    (%rcx),%rax
je     116e <main+0x3e>
mov    0x8(%rsp),%esi
test   %esi,%esi
jle    11fd <main+0xcd>
mov    %r14,%rbx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%r13
movslq 0x8(%rsp),%rsi
add    $0x4,%rbx
cmp    %rsi,%r13
jl     11e0 <main+0xb0>
mov    %r14,%rdi
call   1040 <sort@plt>
mov    0x8(%rsp),%eax
mov    %rbp,%rdi
cmp    $0x3,%eax
jl     11a7 <main+0x77>
mov    0x14(%rsp),%edi
mov    %edi,%ecx
sub    0x10(%rsp),%ecx
mov    $0x2,%esi
mov    %edi,%ebx
mov    0x10(%rsp,%rsi,4),%edi
mov    %edi,%edx
sub    %ebx,%edx
cmp    %ecx,%edx
jne    11a0 <main+0x70>
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1220 <main+0xf0>
mov    %rbp,%rdi
jmp    11a7 <main+0x77>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
br label %14
14: ; preds = %69, %2
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%16 = load i64, i64* @EOF
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %70
18: ; preds = %14
store i32 0, i32* %8
br label %19
19: ; preds = %28, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 %25
%27 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
br label %19
31: ; preds = %19
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 0
%33 = load i32, i32* %7
%34 = call i32 @sort(i32* %32, i32 %33)
store i32 1, i32* %10
%35 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 0
%38 = load i32, i32* %37
%39 = sub nsw i32 %36, %38
store i32 %39, i32* %11
store i32 2, i32* %9
br label %40
40: ; preds = %59, %31
%41 = load i32, i32* %9
%42 = load i32, i32* %7
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %62
44: ; preds = %40
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = load i32, i32* %9
%50 = sub nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = sub nsw i32 %48, %53
%55 = load i32, i32* %11
%56 = icmp ne i32 %54, %55
br i1 %56, label %57, label %58
57: ; preds = %44
store i32 0, i32* %10
br label %62
58: ; preds = %44
br label %59
59: ; preds = %58
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 1
store i32 %61, i32* %9
br label %40
62: ; preds = %57, %40
%63 = load i32, i32* %10
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %69
67: ; preds = %62
%68 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67, %65
br label %14
70: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i32]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast [100 x i32]* %5 to i8*
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %53, label %13
13: ; preds = %2
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 1
br label %16
16: ; preds = %13, %47
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %16, %19
%20 = phi i64 [ %23, %19 ], [ 0, %16 ]
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %20
%22 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = add nuw nsw i64 %20, 1
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %23, %25
br i1 %26, label %19, label %27
27: ; preds = %19, %16
%28 = phi i32 [ %17, %16 ], [ %24, %19 ]
%29 = call i32 @sort(i32* %14, i32 %28)
%30 = load i32, i32* %15
%31 = load i32, i32* %14
%32 = sub nsw i32 %30, %31
%33 = load i32, i32* %4
%34 = icmp sgt i32 %33, 2
br i1 %34, label %35, label %47
35: ; preds = %27
%36 = zext i32 %33 to i64
br label %39
37: ; preds = %39
%38 = icmp eq i64 %46, %36
br i1 %38, label %47, label %39
39: ; preds = %35, %37
%40 = phi i32 [ %30, %35 ], [ %43, %37 ]
%41 = phi i64 [ 2, %35 ], [ %46, %37 ]
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = sub nsw i32 %43, %40
%45 = icmp eq i32 %44, %32
%46 = add nuw nsw i64 %41, 1
br i1 %45, label %37, label %47
47: ; preds = %39, %37, %27
%48 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %27 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %37 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %39 ]
%49 = call i32 @puts(i8* dereferenceable(1) %48)
%50 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%51 = load i64, i64* @EOF
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %16
53: ; preds = %47, %2
ret i32 0
}