class Main {
public static void main(String[] args) {
//JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
System.out.println("请输入第一个数");
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println("请输入第二个数");
int b = sc.nextInt();
boolean res = a == 6|| b == 6 || (a + b) % 6 == 0;
System.out.println(res);
}
}