#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int tpos[200000];
int dtpos[26];
int etpos[26];
int main(int argc, char** argv) {
  string s, t;
  cin >> s >> t;
  int a0 = (int)'a';
  int is = 0;
  int it = 0;
  int sb, se;
  int ind;
  int sln = s.length();
  int tln = t.length();
  while ((is < sln) && (it < tln)) {
    ind = (int)s[is] - a0;
    if (s[is] == t[it]) {
      dtpos[ind] = ++it;
    } else {
      if (!dtpos[ind]) {
        cout << "No";
        return 0;
      }
    }
    tpos[is++] = dtpos[ind];
  }
  sb = is;
  if (it < tln) {
    cout << "No";
    return 0;
  }
  while (is < sln) {
    tpos[is] = dtpos[(int)s[is] - a0];
    if (tpos[is] == 0) {
      cout << "No";
      return 0;
    }
    ++is;
  }
  is = sln;
  --it;
  while ((is > 0) && (it >= 0)) {
    ind = (int)s[--is] - a0;
    if (s[is] == t[it]) {
      etpos[ind] = it + 1;
      --it;
    } else {
      if (!etpos[ind]) {
        cout << "No";
        return 0;
      }
      if (tpos[is] < etpos[ind]) {
        cout << "No";
        return 0;
      }
    }
  }
  se = is;
  cout << "Yes";
  return 0;
}
