A subsequence of length |*x*| of string *s* = *s*<sub class="lower-index">1</sub>*s*<sub class="lower-index">2</sub>... *s*<sub class="lower-index">|*s*|</sub> (where |*s*| is the length of string *s*) is a string *x* = *s*<sub class="lower-index">*k*<sub class="lower-index">1</sub></sub>*s*<sub class="lower-index">*k*<sub class="lower-index">2</sub></sub>... *s*<sub class="lower-index">*k*<sub class="lower-index">|*x*|</sub></sub> (1 ≤ *k*<sub class="lower-index">1</sub> &lt; *k*<sub class="lower-index">2</sub> &lt; ... &lt; *k*<sub class="lower-index">|*x*|</sub> ≤ |*s*|).

You've got two strings — *s* and *t*. Let's consider all subsequences of string *s*, coinciding with string *t*. Is it true that each character of string *s* occurs in at least one of these subsequences? In other words, is it true that for all *i* (1 ≤ *i* ≤ |*s*|), there is such subsequence *x* = *s*<sub class="lower-index">*k*<sub class="lower-index">1</sub></sub>*s*<sub class="lower-index">*k*<sub class="lower-index">2</sub></sub>... *s*<sub class="lower-index">*k*<sub class="lower-index">|*x*|</sub></sub> of string *s*, that *x* = *t* and for some *j* (1 ≤ *j* ≤ |*x*|) *k*<sub class="lower-index">*j*</sub> = *i*.
The first line contains string *s*, the second line contains string *t*. Each line consists only of lowercase English letters. The given strings are non-empty, the length of each string does not exceed 2·10<sup class="upper-index">5</sup>.
import bisect

s = input()
t = input()

max_match = [0 for i in range(len(s))]
min_match = [0 for i in range(len(s))]
char_occur = {}

char_set = set(s+t)
for ch in char_set:
    char_occur[ch] = [i for (i,_ch) in enumerate(t) if ch==_ch]

matched = -1
for (i, ch) in enumerate(s):
    if matched==len(t)-1:
        max_match[i] = matched
    else:
        if ch == t[matched+1]:
            matched += 1
        max_match[i] = matched

matched = len(t)
for (i, ch) in enumerate(s[::-1]):
    i = len(s) - i - 1
    if matched==0:
        min_match[i] = matched
    else:
        if ch == t[matched-1]:
            matched -= 1
        min_match[i] = matched

for (i, ch) in enumerate(s):
    low = min_match[i]
    high = max_match[i]
    occur_idx = bisect.bisect_left(char_occur[ch], low)
    if occur_idx == len(char_occur[ch]):
        print("No")
        exit()
    occur_pos = char_occur[ch][occur_idx]
    if occur_pos > high:
        print("No")
        exit()

print("Yes")