#include #include #include #include #define maxn 40 using namespace std; int a[maxn], tot, len, sum; char ch[maxn]; int main() { while (scanf("%s", ch + 1) == 1){ tot = strlen(ch + 1); sum = 0; len = 0; for (int i = 1; i <= tot && ch[i] >= '0' && ch[i] <= '9'; ++ i){ a[++ len] = ch[i] - '0'; sum += a[len]; } if (sum % 3 == 0 || a[len] % 2 == 0 || a[len] % 5 == 0) puts("YES"); else puts("NO"); } return 0; }