#include <bits/stdc++.h>
char s[200005], t[200005];
int l[200005], r[200005], pos[26];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int ls = strlen(s + 1), lt = strlen(t + 1);
  memset(pos, -1, sizeof(pos));
  for (int i = 1, j = 1; s[i]; i++) {
    if (t[j] && s[i] == t[j]) {
      pos[s[i] - 'a'] = j++;
    }
    l[i] = pos[s[i] - 'a'];
  }
  memset(pos, -1, sizeof(pos));
  for (int i = ls, j = 1; i > 0; i--) {
    if (j <= lt && s[i] == t[lt - j + 1]) {
      pos[s[i] - 'a'] = j++;
    }
    r[i] = pos[s[i] - 'a'];
  }
  bool f = true;
  for (int i = 1; s[i]; i++) {
    if (l[i] == -1 || r[i] == -1 || l[i] + r[i] < lt + 1) {
      f = false;
      break;
    }
  }
  puts(f ? "Yes" : "No");
  return 0;
}
