#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200005];
  char t[200005];
  bool mrk[200005] = {false};
  int i = 0, j = 0, lo[200005], up[200005];
  int bc[26];
  vector<int> abc[26];
  scanf("%s", s);
  scanf("%s", t);
  for (i = 0; s[i]; i++) {
    abc[s[i] - 'a'].push_back(i);
  }
  for (i = 0; i < 26; i++) {
    bc[i] = 0;
  }
  for (i = 0; t[i]; i++) {
    lo[i] = -1;
    up[i] = -1;
    while (s[j] && s[j] != t[i]) j++;
    if (s[j]) lo[i] = j++;
  }
  i--;
  j = strlen(s) - 1;
  for (; i >= 0; i--) {
    while (j >= 0 && s[j] != t[i]) j--;
    if (j >= 0) up[i] = j--;
  }
  int r = 0;
  for (i = 0; t[i]; i++) {
    int x1 = t[i] - 'a';
    if (lo[i] == -1 || up[i] == -1) {
      printf("No\n");
      return 0;
    }
    r = 0;
    for (j = max(lo[i], bc[x1]); j <= up[i]; j++)
      if (s[j] == t[i]) {
        mrk[j] = true;
        r = j;
      }
    bc[x1] = r;
  }
  for (i = 0; s[i]; i++)
    if (!mrk[i]) break;
  if (!s[i])
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
