#include <iostream>
namespace
{
const int& SIX(6);
const int& THREE(3);
const int& SEVEN(7);
}
bool can_arrive(const int& point)
{
if(point == 0) return true;
if(point == 1) return true;
if((point % SIX) == 0) return true;
if((point % THREE) == 0) return true;
for(int jump_one(SEVEN); jump_one <= point; jump_one += SIX)
{
if(jump_one == point) return true;
}
return false;
}
int main()
{
int point;
std::cin >> point;
std::cout << (can_arrive(point) ? "yes" : "no");
return 0;
}