package main import . "fmt" func main() { var n,a int Scan(&n) d:=1 for d0 { a=a^(n/d) n%=d d/=3 } if n==0 { Println("NO") } else { Println("YES") } }