#include <bits/stdc++.h>
using namespace std;
vector<int> LP(const string& S, const string& T) {
  const int M = int((T).size());
  vector<int> pos_in_T[26];
  for (int k = 0; k < M; ++k) pos_in_T[T[k] - 'a'].push_back(k);
  const int N = int((S).size());
  vector<int> res(N, -1);
  for (int i = 0, j = 0; i < N; ++i) {
    if (j < M && S[i] == T[j]) {
      res[i] = ++j;
    } else {
      int ch_id = S[i] - 'a';
      auto it = lower_bound(pos_in_T[ch_id].begin(), pos_in_T[ch_id].end(), j);
      res[i] = it == pos_in_T[ch_id].begin() ? -1 : *prev(it) + 1;
    }
  }
  return res;
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string S, T;
  cin >> S;
  cin >> T;
  vector<int> L = LP(S, T);
  reverse(S.begin(), S.end());
  reverse(T.begin(), T.end());
  vector<int> R = LP(S, T);
  reverse(R.begin(), R.end());
  for (int& x : R) x = int((T).size()) - x + 1;
  bool ok = true;
  for (int i = 0; i < int((S).size()); ++i) {
    if (L[i] < 0 || R[i] < 0 || L[i] < R[i]) {
      ok = false;
      break;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
