#include <bits/stdc++.h>
using namespace std;
struct node {
  int t;
  char s, c;
};
bool Cmp(struct node a, struct node b) { return (a.t < b.t); }
int main() {
  static char a[400005];
  static char b[400005];
  int ac, bc;
  scanf("%s\n", &(a[1]));
  scanf("%s", &(b[1]));
  ac = strlen(&(a[1]));
  bc = strlen(&(b[1]));
  static int L[400005];
  static int R[400005];
  int i;
  L[0] = 0;
  for (i = 1; i <= bc; i++) {
    L[i] = L[i - 1] + 1;
    while ((L[i] <= ac) && (a[L[i]] != b[i])) (L[i])++;
    if (L[i] > (ac + 1)) L[i] = ac + 1;
  }
  R[bc + 1] = ac + 1;
  for (i = bc; i >= 1; i--) {
    R[i] = R[i + 1] - 1;
    while ((R[i] >= 1) && (a[R[i]] != b[i])) (R[i])--;
    if (R[i] < 0) R[i] = 0;
  }
  static struct node res[400005];
  int resc = 0;
  int l, r;
  for (i = 1; i <= bc; i++) {
    l = L[i - 1] + 1;
    r = R[i + 1] - 1;
    if (r >= l) {
      res[resc].t = l;
      res[resc].s = '+';
      res[resc].c = b[i];
      resc++;
      res[resc].t = r + 1;
      res[resc].s = '-';
      res[resc].c = b[i];
      resc++;
    }
  }
  if (resc) sort(&(res[0]), &(res[resc]), Cmp);
  int pos = 0;
  static int flag[256];
  memset(flag, 0, sizeof(flag));
  for (i = 1; i <= ac; i++) {
    while ((pos < resc) && (res[pos].t == i)) {
      if (res[pos].s == '+')
        (flag[(int)(res[pos].c)])++;
      else
        (flag[(int)(res[pos].c)])--;
      pos++;
    }
    if (flag[(int)(a[i])] == 0) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
