#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  getline(cin, s);
  getline(cin, t);
  vector<int> f(t.size());
  vector<int> l(t.size());
  int j = 0;
  for (int i = 0; i < s.size() && j < t.size(); i++) {
    if (s[i] == t[j]) {
      f[j] = i;
      j++;
    }
  }
  if (j < t.size()) {
    cout << "No" << endl;
    return 0;
  }
  j = t.size() - 1;
  for (int i = s.size() - 1; i >= 0 && j >= 0; i--) {
    if (s[i] == t[j]) {
      l[j] = i;
      j--;
    }
  }
  vector<pair<int, int> > sweep;
  for (int j = 0; j < t.size(); j++) {
    sweep.push_back(make_pair(f[j], j));
    sweep.push_back(make_pair(l[j] + 1, j));
  }
  sort(sweep.begin(), sweep.end());
  vector<int> count(30, 0);
  int i = 0;
  for (int k = 0; k < s.size(); k++) {
    for (; sweep[i].first == k; i++) {
      int j = sweep[i].second;
      int idx = sweep[i].first;
      int curchar = t[j] - 'a';
      if (idx == f[j]) {
        count[curchar]++;
      }
      if (idx == l[j] + 1) {
        count[curchar]--;
      }
    }
    if (count[s[k] - 'a'] <= 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
