In the vibrant city of Upside, nestled within its downtown, lies a community with a distinctive tradition – the Upside Downtown. Here, house numbers are not just sequences of digits; they are an art form. The residents take pride in crafting numbers that are not only readable right side up but also readable when rotated $$$180$$$ degrees (viewed upside down).
Specifically, the digits $$$0, 1, 6, 8$$$, and $$$9$$$ can be read in both directions. However, house numbers cannot begin with a $$$0$$$ in any orientation.
A new house is being built in this community and you must determine whether its house number complies with this "Upside-Down House Numbers" tradition. Given a proposed house number, determine if it can be read both right side up and upside down.
The input consists of a single positive integer (possibly containing leading zeroes) $$$N\ (1 \leq N \leq 10^9)$$$ representing the proposed house number.
Output "YES" if the house number is a masterpiece, and "NO" otherwise.
801
YES
680
NO
906
YES
123
NO
01
NO