import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
	public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
	public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int a[] = new int[2]; a new int[2] 2 a[0] = 4 a[0] a 0 4 a[1] = 7 a[1] a 1 7 if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} dfs(0, N, a) dfs 0 N a {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String args[] args public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	} dfs {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	} if(sum >= N) return sum == N; sum >= N sum N return sum == N; sum == N sum N if(dfs(sum + a[0], N, a)) return true; dfs(sum + a[0], N, a) dfs sum + a[0] sum a[0] a 0 N a return true; true if(dfs(sum + a[1], N, a)) return true; dfs(sum + a[1], N, a) dfs sum + a[1] sum a[1] a 1 N a return true; true return false; false int sum sum int N N int a[] a public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
	public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
	public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	}
} Main
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int a[] = new int[2];
		a[0] = 4;
		a[1] = 7;
		if(dfs(0, N, a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
	public static boolean dfs(int sum, int N, int a[]) {
		if(sum >= N) return sum == N;
		if(dfs(sum + a[0], N, a)) return true;
		if(dfs(sum + a[1], N, a)) return true;
		return false;
	}
}
