#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
char a[N], b[N];
int L[N], R[N], la, lb;
int lastpos[30];
int main() {
  scanf("%s%s", a, b);
  la = strlen(a);
  lb = strlen(b);
  memset(lastpos, -1, sizeof(lastpos));
  int i, cur = 0;
  for (i = 0; i < la; i++) {
    if (cur < lb && a[i] == b[cur]) {
      L[i] = lastpos[a[i] - 'a'] = cur++;
    } else {
      L[i] = lastpos[a[i] - 'a'];
    }
  }
  memset(lastpos, -1, sizeof(lastpos));
  cur = lb - 1;
  for (i = la - 1; i >= 0; i--) {
    if (cur >= 0 && a[i] == b[cur]) {
      R[i] = lastpos[a[i] - 'a'] = cur--;
    } else {
      R[i] = lastpos[a[i] - 'a'];
    }
  }
  for (i = 0; i < la; i++) {
    if (L[i] == -1 || R[i] == -1 || L[i] < R[i]) return printf("No\n"), 0;
  }
  printf("Yes\n");
  return 0;
}
