CodeChef Array Transform Program!
Here's the Problem Statement : 

    

> Given n numbers, you can perform the
> following operation any number of
> times : Choose any subset of the
> numbers, none of which are 0.
> Decrement the numbers in the subset by
> 1, and increment the numbers not in
> the subset by K.
>     Is it possible to perform operations such that all numbers
> except one of them become 0 ?
>     Input :
>     The first line contains the number of test cases T. 2*T lines follow, 2
> for each case. The first line of a
> test case contains the numbers n and
> K. The next line contains n numbers,
> a_1...a_n.
>     Output :
>     Output T lines, one corresponding to each test case. For a test case,
> output "YES" if there is a sequence of
> operations as described, and "NO"
> otherwise.
>     Sample Input :
>     3
>     2 1
>     10 10
>     3 2
>     1 2 2
>     3 2
>     1 2 3
>     
>     Sample Output :
>     YES
>     YES
>     NO
>     
>     Constraints :
>     1 <= T <= 1000
>     2 <= n <= 100
>     1 <= K <= 10
>     0 <= a_i <= 1000

& Here's my code : 

    #include <iostream>
    using namespace std;
    bool is_possible(int a[],int size,int k_1);
    int main()
    {
    int no_of_tests;
    cin>>no_of_tests;
    int size ;
    int a[100];
    bool yes;
    int j;
    int k;
    for(int i = 0;i<no_of_tests;i++)
    {
    cin>>size>>k;
    for(j=0;j<size;j++)
    {
    cin>>a[j];;
    }
    yes = is_possible(a,size,k+1);
    if(yes)
    cout<<"YES\n";
    else
    cout<<"NO\n";
    }
    }
    bool is_possible(int a[],int size,int k_1)
    {
    int count = 0;
    int m[2] ={-1,-1} ;
    int mod;
    for(int i = 0;i<size;i++)
    {
    mod = a[i]%k_1;
    if(m[0]!=mod && m[1]!=mod)
    {
    if(m[0]==-1)
    m[0] = mod;
    else if(m[1] == -1)
    m[1] = mod;
    else
    return false;
    }
    }
    return true;
    }

What's wrong in my code?
Why am I getting Wrong Answer?

CodeChef Array Transform Program!
===

Here's the Problem Statement : 

    

> Given n numbers, you can perform the
> following operation any number of
> times : Choose any subset of the
> numbers, none of which are 0.
> Decrement the numbers in the subset by
> 1, and increment the numbers not in
> the subset by K.
>     Is it possible to perform operations such that all numbers
> except one of them become 0 ?
>     Input :
>     The first line contains the number of test cases T. 2*T lines follow, 2
> for each case. The first line of a
> test case contains the numbers n and
> K. The next line contains n numbers,
> a_1...a_n.
>     Output :
>     Output T lines, one corresponding to each test case. For a test case,
> output "YES" if there is a sequence of
> operations as described, and "NO"
> otherwise.
>     Sample Input :
>     3
>     2 1
>     10 10
>     3 2
>     1 2 2
>     3 2
>     1 2 3
>     
>     Sample Output :
>     YES
>     YES
>     NO
>     
>     Constraints :
>     1 <= T <= 1000
>     2 <= n <= 100
>     1 <= K <= 10
>     0 <= a_i <= 1000

& Here's my code : 

    #include <iostream>
    using namespace std;
    bool is_possible(int a[],int size,int k_1);
    int main()
    {
    int no_of_tests;
    cin>>no_of_tests;
    int size ;
    int a[100];
    bool yes;
    int j;
    int k;
    for(int i = 0;i<no_of_tests;i++)
    {
    cin>>size>>k;
    for(j=0;j<size;j++)
    {
    cin>>a[j];;
    }
    yes = is_possible(a,size,k+1);
    if(yes)
    cout<<"YES\n";
    else
    cout<<"NO\n";
    }
    }
    bool is_possible(int a[],int size,int k_1)
    {
    int count = 0;
    int m[2] ={-1,-1} ;
    int mod;
    for(int i = 0;i<size;i++)
    {
    mod = a[i]%k_1;
    if(m[0]!=mod && m[1]!=mod)
    {
    if(m[0]==-1)
    m[0] = mod;
    else if(m[1] == -1)
    m[1] = mod;
    else
    return false;
    }
    }
    return true;
    }

What's wrong in my code?
Why am I getting Wrong Answer?
