#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int le[1000000];
int ri[1000000];
int main() {
  ios::sync_with_stdio(false);
  cin >> s1 >> s2;
  {
    int i1 = 0;
    for (int i2 = 0; i2 < int(s2.size()); i2++) {
      while (i1 < int(s1.size()) and s1[i1] != s2[i2]) i1++;
      if (i1 >= int(s1.size())) {
        cout << "No" << endl;
        exit(0);
      }
      le[i2] = i1;
      i1++;
    }
  }
  {
    int i1 = int(s1.size()) - 1;
    for (int i2 = int(s2.size()) - 1; i2 >= 0; i2--) {
      while (i1 >= 0 and s1[i1] != s2[i2]) i1--;
      if (i1 < 0) {
        cout << "No" << endl;
        exit(0);
      }
      ri[i2] = i1;
      i1--;
    }
  }
  for (int ic = 0; ic < 26; ic++) {
    char c = char(ic + 'a');
    int i2 = 0;
    for (int i1 = 0; i1 < int(s1.size()); i1++) {
      if (s1[i1] == c) {
        while (i2 < int(s2.size()) and
               (s2[i2] != c or not(le[i2] <= i1 and ri[i2] >= i1)))
          i2++;
        if (i2 >= int(s2.size())) {
          cout << "No" << endl;
          exit(0);
        }
      }
    }
  }
  cout << "Yes" << endl;
}
