For this Question: Swastik initially has rupees 1000 with him, he goes to a candy shop to buy some candies. There are only two types of candies available which costs 3 and 7 rupees. Swastik can buy any number of candies he wants, possibly 0, with the money he have.
Given the remaining amount of money he had left with him, your task to check whether the amount he have is possible or not.First line of input contains the number of test cases T, next T lines contains a single integer M(remaining amount).

Constraints :-
1 < = T < = 100
1 < = M < = 1000For each test case, in a new line print "Yes" if possible or "No" if not.Sample Input:-
3
995
997
994

Sample Output:-
No
Yes
Yes, I have written this Solution Code: 
// author-Shivam gupta

#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795

#define MOD 1000000007

#define read(type) readInt<type>()
#define max1 100001
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}


// Returns true if d is present as digit
// in number x.
bool isDigitPresent(int x, int d)
{
    // Breal loop if d is present as digit
    while (x > 0)
    {
        if (x % 10 == d)
            break;

        x = x / 10;
    }

    // If loop broke
    return (x > 0);
}

// function to display the values
void printNumbers(int n, int d)
{
    // Check all numbers one by one
    for (int i = 0; i <= n; i++)

        // checking for digit
        if (i == d || isDigitPresent(i, d))
            cout << i << " ";
}

signed main()
{


     bool sieve[1001] = {0};
    sieve[1000] = true;
    for (int i = 999; i >= 0; i--) {
        if (i+3 <= 1000 && sieve[i+3]) {
            sieve[i] = true;
        } else if (i+7 <= 1000 && sieve[i+7]) {
            sieve[i] = true;
        }
    }

	int t;
	cin >> t;
	while (t-- > 0) {
	    int n; cin >> n;
	    if(sieve[n]){
            out("Yes");
	    }
	    else{out("No");}
	}
	return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?