Luck Number
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 128 M,其他语言256 M
64bit IO Format: %lld

题目描述

Let us remind you that lucky numbers are possible integers whose decimal representation only contains luck digit 6 and 8, also, it much have factors 4 and 7. For example 868, 6888 are luck and 678, 886 are not.

You are given n positive integers, you should check whether the integer is lucky.

输入描述:

The first line contains one integers n (1≤n≤1000). The next n
line contains n integers ai (1≤ai≤1e100)—the numbers that you should check.

输出描述:

N lines, if ai is lucky number, print
“YES”, else print “NO”.
示例1

输入

复制
2
868
886

输出

复制
YES
NO