#include <bits/stdc++.h>
using namespace std;
inline void setIO(string a) {}
char s[200005], t[200005];
int n, m, L[200005], R[200005];
int cha[27][200005];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  n = strlen(s + 1);
  m = strlen(t + 1);
  int pi = 1;
  for (int i = (1); i <= (m); i++) {
    while (s[pi] != t[i] && pi <= n) ++pi;
    if (pi > n) {
      puts("No");
      return 0;
    }
    L[i] = pi;
    ++pi;
  }
  pi = n;
  for (int i = (m); i >= (1); i--) {
    while (s[pi] != t[i] && pi >= 1) --pi;
    if (pi <= 0) {
      puts("No");
      return 0;
    }
    R[i] = pi;
    --pi;
  }
  for (int i = (1); i <= (m); i++) {
    cha[t[i] - 'a'][L[i]]++;
    cha[t[i] - 'a'][R[i] + 1]--;
  }
  for (int i = (0); i <= (25); i++)
    for (int j = (1); j <= (n); j++) cha[i][j] += cha[i][j - 1];
  for (int i = (1); i <= (n); i++) {
    int z = cha[s[i] - 'a'][i];
    if (!z) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}
