#include <bits/stdc++.h>
char s[2 * 100010];
char p[2 * 100010];
int mx[2 * 100010], mn[2 * 100010], dp[26], pos, ls, lp;
bool fuck() {
  ls = strlen(s), lp = strlen(p);
  for (int i = 0; i < 26; i++) dp[i] = -1;
  pos = 0;
  for (int i = 0; i < ls; i++) {
    if (pos < lp && s[i] == p[pos]) dp[s[i] - 'a'] = pos++;
    mx[i] = dp[s[i] - 'a'];
  }
  for (int i = 0; i < 26; i++) dp[i] = -1;
  pos = lp - 1;
  for (int i = ls - 1; i >= 0; i--) {
    if (pos >= 0 && s[i] == p[pos]) dp[s[i] - 'a'] = pos--;
    mn[i] = dp[s[i] - 'a'];
  }
  for (int i = 0; i < ls; i++) {
    if (mx[i] == -1 || mn[i] == -1 || mn[i] > mx[i]) return false;
  }
  return true;
}
int main() {
  while (scanf("%s %s", s, p) != EOF) puts(fuck() ? "Yes" : "No");
  return 0;
}
