Score : $100$ points
You are given two different strings $S$ and $T$.
If $S$ is lexicographically smaller than $T$, print Yes
; otherwise, print No
.
Simply speaking, the lexicographical order is the order in which words are listed in a dictionary. As a more formal definition, here is the algorithm to determine the lexicographical order between different strings $S$ and $T$.
Below, let $S_i$ denote the $i$-th character of $S$. Also, if $S$ is lexicographically smaller than $T$, we will denote that fact as $S \lt T$; if $S$ is lexicographically larger than $T$, we will denote that fact as $S \gt T$.
Note that many major programming languages implement lexicographical comparison of strings as operators or functions in standard libraries. For more detail, see your language's reference.
Input is given from Standard Input in the following format:
$S$ $T$
If $S$ is lexicographically smaller than $T$, print Yes
; otherwise, print No
.
abc atcoder
Yes
abc
and atcoder
begin with the same character, but their second characters are different. Since b
comes earlier than t
in alphabetical order, we can see that abc
is lexicographically smaller than atcoder
.
arc agc
No
a aa
Yes