#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
string s, t;
int p[200000];
int q[200000];
int cnt[200001][26];
int main() {
  cin >> s >> t;
  n = ((int)(s).size());
  m = ((int)(t).size());
  for (int i = m - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) cnt[i][j] = cnt[i + 1][j];
    cnt[i][t[i] - 'a']++;
  }
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (j < m && s[i] == t[j]) j++;
    p[i] = j;
  }
  j = m;
  for (int i = n - 1; i >= 0; i--) {
    if (j > 0 && s[i] == t[j - 1]) j--;
    q[i] = j;
  }
  for (int i = 0; i < n; i++)
    if (cnt[q[i]][s[i] - 'a'] - cnt[p[i]][s[i] - 'a'] <= 0) {
      printf("No\n");
      return 0;
    }
  printf("Yes\n");
  return 0;
}
