#include <bits/stdc++.h>
using namespace std;
int st_max[200010], dr_max[200010];
string a, b;
bool calc_stmax();
bool calc_drmax();
int frc[2000];
bool ap[200010];
int main() {
  cin >> a >> b;
  if (!calc_stmax() || !calc_drmax()) {
    cout << "No";
    return 0;
  }
  vector<pair<int, int>> events;
  for (int i(1); i < b.size(); i++) {
    events.push_back({st_max[i], i});
    events.push_back({dr_max[i] + 1, i});
  }
  events.push_back({0, 0});
  events.push_back({dr_max[0] + 1, 0});
  sort(events.begin(), events.end());
  for (int i(0), j(0); j < a.size(); j++) {
    while (i < events.size() && events[i].first <= j) {
      if (ap[events[i].second])
        frc[b[events[i].second]]--;
      else {
        ap[events[i].second] = 1;
        frc[b[events[i].second]]++;
      }
      i++;
    }
    if (!frc[a[j]]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
bool calc_drmax() {
  int dr(a.size() - 1);
  for (int i(b.size() - 1); i >= 0; i--) {
    while (dr >= 0 && a[dr] != b[i]) dr--;
    if (dr == -1) return false;
    dr_max[i] = dr;
    dr--;
  }
  return true;
}
bool calc_stmax() {
  int dr(0);
  for (int i(0); i < b.size(); i++) {
    while (dr < a.size() && a[dr] != b[i]) dr++;
    if (dr == a.size()) return false;
    st_max[i] = dr;
    dr++;
  }
  return true;
}
