Is it an Ordered Word? (inspired by this post over on Puzzling. CAUTION: SPOILERS FOR THAT PUZZLE ARE BELOW.)

The standard telephone keypad correlates letters to numbers as follows:

1 -&gt;
2 -&gt; ABC
3 -&gt; DEF
4 -&gt; GHI
5 -&gt; JKL
6 -&gt; MNO
7 -&gt; PQRS
8 -&gt; TUV
9 -&gt; WXYZ
0 -&gt;


A given input word is defined to be an Ordered Word if, when translated to keypad presses using the above, the resulting number is either non-decreasing or non-increasing. In other words, the resultant number cannot both increase and decrease.

For example, the word CAT translates to 228, which is non-decreasing, and thus an Ordered Word. However, the word DOG is 364, which both increases and decreases, and thus is not an Ordered Word.

The challenge

Given a word, output whether or not it's Ordered.

Input


A word (not necessarily a dictionary word) consisting of ASCII alphabet ([A-Z] or [a-z]) letters only, in any suitable format.
Your choice if the input is all uppercase or all lowercase, but it must be consistent.
The word will be at least 3 characters in length.


Output

A consistent truthy/falsey value for whether the input word is Ordered (truthy) or not Ordered (falsey).

Rules


Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.


Examples

Here are some Ordered Words (i.e., truthy), and there are more on the linked Puzzling puzzle.

CAT
TAC
AAA
DEMONS
SKID
LKJONMSRQP
ABCDEFGHIJKLMNOPQRSTUVWXYZ


Here are some non-Ordered Words (i.e., falsey)

DOG
GOD
ROSE
COFFEE
JKLMNOGHI
Python 2, 164 148 132 77 bytes

-16 bytes thanks to Rod's suggestion elsewhere. A frickin' -55 bytes thanks to Arnold Palmer.



n=[min(int((ord(i)-58)/3.13),9)for i in input()]
print sorted(n)in[n,n[::-1]]


Try it online!

Input must be uppercase. Outputs True or False based on its orderedness.



Explanation

The first line maps each letter to a number.

                               for i in input()   # iterate over the input string
            ord(i)                                # take the ASCII ordinal
                  -58                             # subtract 58
           (         )/3.13                       # divide by 3.13
       int(                )                      # chop off the fractional part
   min(                     ,9)                   # choose the minimum between the number and 9
n=[                                            ]  # assign the resulting list to n


This works based on:

          | A   B   C  | D   E   F  | G   H   I  | J   K   L  | M   N   O  | P   Q   R   S  | T   U   V  | W   X   Y   Z
----------+------------+------------+------------+------------+------------+----------------+------------+-----------------
ord(x)    | 65  66  67 | 68  69  70 | 71  72  73 | 74  75  76 | 77  78  79 | 80  81  82  83 | 84  85  86 | 87  88  89  90
----------+------------+------------+------------+------------+------------+----------------+------------+-----------------
x - 58    | 7   8   9  | 10  11  12 | 13  14  15 | 16  17  18 | 19  20  21 | 22  23  24  25 | 26  27  28 | 29  30  31  32
----------+------------+------------+------------+------------+------------+----------------+------------+-----------------
x ÷ 3.13* | 2.2 2.6 2.9| 3.2 3.5 3.8| 4.2 4.5 4.8| 5.1 5.4 5.8| 6.1 6.4 6.7| 7.0 7.3 7.7 7.9| 8.3 8.6 8.9| 9.3 9.6 9.9 10.2
----------+------------+------------+------------+------------+------------+----------------+------------+-----------------
int(x)    | 2   2   2  | 3   3   3  | 4   4   4  | 5   5   5  | 6   6   6  | 7   7   7   7  | 8   8   8  | 9   9   9   10
----------+------------+------------+------------+------------+------------+----------------+------------+-----------------
min(x, 9) | 2   2   2  | 3   3   3  | 4   4   4  | 5   5   5  | 6   6   6  | 7   7   7   7  | 8   8   8  | 9   9   9   9


*Values are rounded. :P

The second line outputs if the list of numbers is in ascending or descending order.

print                                             # print whether...
      sorted(n)                                   # n sorted...
               in[n,n[::-1]]                      # is equivalent to n or n reversed