#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > lim[26];
char s[222222], t[222222];
int m, n, cs[26], d[26], first[222222], last[222222];
int main() {
  scanf("%s\n", s);
  scanf("%s\n", t);
  int m = strlen(s), n = strlen(t);
  int vt = -1;
  for (int i = 0; i <= n - 1; ++i) {
    do {
      ++vt;
    } while (vt < m && s[vt] != t[i]);
    if (vt == m) {
      printf("No\n");
      return 0;
    }
    first[i] = vt;
  }
  vt = m;
  for (int i = n - 1; i >= 0; --i) {
    do {
      --vt;
    } while (vt >= 0 && s[vt] != t[i]);
    if (vt < 0) {
      printf("No\n");
      return 0;
    }
    last[i] = vt;
  }
  first[n] = last[n] = m;
  for (int i = 0; i <= n - 1; ++i)
    lim[t[i] - 'a'].push_back(pair<int, int>(first[i], last[i]));
  for (int i = 0; i <= 25; ++i) cs[i] = 0, d[i] = lim[i].size();
  first[n] = last[n] = m;
  for (int i = 0; i <= m - 1; ++i) {
    int c = s[i] - 'a';
    while (cs[c] < d[c] && lim[c][cs[c]].second < i) ++cs[c];
    if (cs[c] == d[c]) {
      printf("No\n");
      return 0;
    }
    if (lim[c][cs[c]].first > i) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
}
