#K40727. Coin Combination Challenge

    ID: 26707 Type: Default 1000ms 256MiB

Coin Combination Challenge

Coin Combination Challenge

Given an integer amount \(a\), determine whether it is possible to form the sum \(a\) using coins of denominations \(3\), \(7\), and \(11\) units. That is, check if there exist non-negative integers \(x\), \(y\), and \(z\) such that:

\(3x + 7y + 11z = a\)

Output "YES" if it is possible, and "NO" otherwise.

inputFormat

The first line contains a single integer \(T\) which denotes the number of test cases. Each of the following \(T\) lines contains one integer \(a\) — the amount to be tested.

outputFormat

For each test case, output a single line with either "YES" if the given amount can be formed using coins of 3, 7, and 11, or "NO" if it cannot.

## sample
4
10
14
1
30
YES

YES NO YES

</p>