#include <bits/stdc++.h>
using namespace std;
long int i, j, l1, l2, a[200001][26], cur, r[200001], l[200001];
char s[200001], t[200001];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  l1 = strlen(s + 1);
  l2 = strlen(t + 1);
  for (i = 1; i <= l2; i++) {
    for (j = 0; j < 26; j++) {
      if (t[i] - 'a' == j)
        a[i][j] = i;
      else
        a[i][j] = a[i - 1][j];
    }
  }
  cur = 1;
  for (i = 1; i <= l1; i++) {
    l[i] = l[i - 1];
    if (s[i] == t[cur]) {
      cur++;
      l[i]++;
    }
  }
  cur = l2;
  for (i = l1; i >= 1; i--) {
    r[i] = r[i + 1];
    if (s[i] == t[cur]) {
      cur--;
      r[i]++;
    }
  }
  for (i = 1; i <= l1; i++) {
    j = a[l[i]][s[i] - 'a'];
    if (j == 0) {
      cout << "No";
      return 0;
    } else if (r[i] <= l2 - j) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
