#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30) - 1;
const long double eps = 1e-9;
const long double pi = fabs(atan2(0.0, -1.0));
void ML() {
  int *ass;
  for (;;) {
    ass = new int[2500000];
    for (int i = 0; i < 2500000; i++) ass[i] = rand();
  }
}
string s, t;
int n, m;
void LoAd() {
  cin >> s >> t;
  n = (int)s.size();
  m = (int)t.size();
}
int st[200500];
int fi[200500];
vector<vector<pair<int, int> > > tor;
int sv[26];
void SoLvE() {
  if (t.size() > s.size()) {
    puts("No");
    return;
  }
  int j = 0;
  for (int i = 0; j < m; i++) {
    if (n == i) {
      puts("No");
      return;
    }
    if (s[i] == t[j]) {
      st[j] = i;
      j++;
    }
  }
  j = m - 1;
  for (int i = n - 1; j >= 0; i--) {
    if (-1 == i) {
      puts("No");
      return;
    }
    if (s[i] == t[j]) {
      fi[j] = i;
      j--;
    }
  }
  tor.resize(26);
  for (int i = 0; i < m; i++) {
    tor[t[i] - 'a'].push_back(make_pair(st[i], fi[i]));
  }
  for (int i = 0; i < 26; i++) sv[i] = 0;
  for (int i = 0; i < n; i++) {
    for (;; sv[s[i] - 'a']++) {
      int j = sv[s[i] - 'a'];
      if (j == tor[s[i] - 'a'].size()) {
        puts("No");
        return;
      }
      if (tor[s[i] - 'a'][j].first <= i && i <= tor[s[i] - 'a'][j].second)
        break;
    }
  }
  puts("Yes");
}
int main() {
  srand((int)time(NULL));
  LoAd();
  SoLvE();
  return 0;
}
