#include <bits/stdc++.h>
using namespace std;
int bv[1000000];
int ev[1000000];
int co[26][1000000];
int main() {
  string s, t;
  cin >> s >> t;
  int in = 0;
  for (int i = 0; i < s.size(); i++) {
    bv[i] = in;
    if (in < t.size() - 1 && t[in] == s[i]) {
      in++;
    }
  }
  for (int i = 0; i < t.size(); i++) {
    for (int j = 0; j < 26; j++) {
      if (i > 0) co[j][i] = co[j][i - 1];
      co[j][i] += (t[i] - 'a' == j);
    }
  }
  in = t.size() - 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    ev[i] = in;
    if (in > 0 && t[in] == s[i]) {
      in--;
    }
  }
  for (int i = 0; i < s.size(); i++) {
    int b = bv[i];
    int e = ev[i];
    if (e - b > 0) {
      cout << "No";
      return 0;
    }
    int mo = co[s[i] - 'a'][b] - co[s[i] - 'a'][e] + (t[e] == s[i]);
    if (mo == 0) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
