#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  string s, t;
  cin >> s >> t;
  vector<vector<int> > T(('z' - 'a' + 1));
  for (int i = (0); i <= ((int)(t).size() - 1); ++i) T[t[i] - 'a'].push_back(i);
  t = '#' + t + '#';
  int n = (int)(s).size();
  vector<int> pref(n + 1, 0), suff(n + 1, (int)(t).size() - 2);
  for (int i = (1); i <= (n); ++i)
    pref[i] = pref[i - 1] + (s[i - 1] == t[pref[i - 1] + 1]);
  for (int i = (n - 1); i >= (0); --i)
    suff[i] = suff[i + 1] - (s[i] == t[suff[i + 1]]);
  for (int i = (0); i <= ((int)(s).size() - 1); ++i) {
    int before = pref[i], after = suff[i + 1] - 1, c = s[i] - 'a',
        st = lower_bound(T[c].begin(), T[c].end(), after) - T[c].begin();
    if (st == (int)(T[c]).size() || T[c][st] > before) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
