#C3047. Taco Transformation
Taco Transformation
Taco Transformation
You are given two integers a and b. Your task is to determine whether it is possible to transform a into b using a custom defined operation. The operation is defined as follows: you can append some digits to the right of a (i.e. perform a combine operation) so that the resulting number has b as its target form.
In other words, if we denote the decimal representation of a by \(a_s\) and that of b by \(b_s\), then the transformation is possible if and only if \(b_s\) starts with \(a_s\). Mathematically, this condition can be written as:
[ b_s = a_s ; X, ]
where \(X\) represents some (possibly empty) string of digits. If the condition holds, print YES
; otherwise, print NO
.
inputFormat
The input consists of two space-separated integers a
and b
provided via standard input.
Example:
123 1234
outputFormat
Output a single line containing either YES
if the transformation is possible, or NO
otherwise.
123 1234
YES
</p>