#include <bits/stdc++.h>
char a[1000010], b[1000010];
int T[1000010];
int A[30], B[30], n, n1, i, j, yes;
int main() {
  while (scanf("%s %s", a, b) == 2) {
    n = strlen(a);
    n1 = strlen(b);
    for (i = 0; i <= 26; i++) {
      A[i] = -1;
      B[i] = -1;
    }
    j = 0;
    for (i = 0; i < n; i++) {
      if (j < n1 && b[j] == a[i]) {
        A[a[i] - 'a'] = j;
        j++;
      }
      T[i] = A[a[i] - 'a'];
    }
    yes = 1;
    j = n1 - 1;
    for (i = n - 1; i >= 0; i--) {
      if (j >= 0 && b[j] == a[i]) {
        B[a[i] - 'a'] = j;
        j--;
      }
      if (B[a[i] - 'a'] == -1 || T[i] < B[a[i] - 'a']) {
        yes = 0;
        break;
      }
    }
    if (yes == 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
