#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > w, dp;
string s, t;
int k;
int main() {
  cin >> s;
  cin >> t;
  if (t.size() > s.size()) {
    cout << "No";
    return 0;
  }
  dp.resize(2);
  dp[0].resize(s.size());
  dp[1].resize(s.size());
  w.resize(2);
  w[0].resize(26);
  w[1].resize(26);
  k = 0;
  for (int i = 0; i < s.size(); i++) {
    if (k >= t.size()) {
      dp[0][i] = w[0][s[i] - 97];
      continue;
    }
    if (s[i] == t[k]) {
      k++;
      w[0][s[i] - 97] = k;
      dp[0][i] = k;
    } else {
      dp[0][i] = w[0][s[i] - 97];
    }
  }
  k = t.size() - 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (k < 0) {
      dp[1][i] = w[1][s[i] - 97];
      continue;
    }
    if (s[i] == t[k]) {
      w[1][s[i] - 97] = t.size() - k + 1;
      dp[1][i] = t.size() - k + 1;
      k--;
    } else {
      dp[1][i] = w[1][s[i] - 97];
    }
  }
  for (int i = 0; i < s.size(); i++)
    if (dp[0][i] + dp[1][i] < t.size()) {
      cout << "No";
      return 0;
    }
  cout << "Yes";
  return 0;
}
