Rotational Display Check

A museum installs a vintage digital display that visitors can view from either side. When the panel is rotated 180 degrees, only certain digits remain readable. The digit 0 still looks like 0, 1 still looks like 1, 8 still looks like 8, 6 becomes 9, and 9 becomes 6. Digits 2, 3, 4, 5, and 7 have no valid rotated form and break the illusion.

A number is considered valid for the rotational display if it appears unchanged after this 180 degree rotation. In other words, reading the rotated image from left to right gives the original number back.

Given a string num representing a non negative integer without leading zeros unless the number itself is "0", determine whether num is valid for the rotational display. Return true if it is, otherwise false.

Examples
Input: "69"
Output: true
Hints
Related Problems

Rotational Display Check

A museum installs a vintage digital display that visitors can view from either side. When the panel is rotated 180 degrees, only certain digits remain readable. The digit 0 still looks like 0, 1 still looks like 1, 8 still looks like 8, 6 becomes 9, and 9 becomes 6. Digits 2, 3, 4, 5, and 7 have no valid rotated form and break the illusion.