#include <bits/stdc++.h>
using namespace std;
const int NMax = 200001;
const int cntTree = 262145;
const double eps = 1e-9;
const double PI = 3.141592653589793238462;
const int MD = (int)1e9 + 7;
string s, t;
int dp1[NMax], dp2[NMax], c[123], pos[NMax][123];
bool status[NMax];
int main() {
  cin >> s >> t;
  int in = 0;
  if (s[0] == t[0])
    dp1[0] = 1, in++;
  else
    dp1[0] = 0;
  for (int i = 1; i < (int)(s).size(); i++) {
    dp1[i] = dp1[i - 1];
    if (in < (int)(t).size() && s[i] == t[in]) {
      dp1[i]++;
      in++;
    }
  }
  in = (int)(t).size() - 1;
  if (s[(int)(s).size() - 1] == t[in])
    dp2[(int)(s).size() - 1] = 1, in--;
  else
    dp2[(int)(s).size() - 1] = 0;
  for (int i = (int)(s).size() - 2; i > 0; --i) {
    dp2[i] = dp2[i + 1];
    if (in >= 0 && s[i] == t[in]) {
      dp2[i]++;
      in--;
    }
  }
  for (int i = 0; i < (int)(t).size(); i++) {
    c[t[i]]++;
    pos[c[t[i]]][t[i]] = i;
  }
  for (int i = 1; i < (int)(s).size() - 1; i++) {
    if (c[s[i]] == 0) {
      cout << "No" << endl;
      return 0;
    }
    int l = 1, r = c[s[i]];
    while (l + 1 < r) {
      int m = (l + r) / 2;
      if (dp1[i - 1] >= pos[m][s[i]] &&
          dp2[i + 1] >= (int)(t).size() - pos[m][s[i]] - 1) {
        status[i] = true;
        break;
      }
      if (dp1[i - 1] >= pos[m][s[i]] &&
          dp2[i + 1] < (int)(t).size() - pos[m][s[i]] - 1)
        l = m;
      if (dp1[i - 1] < pos[m][s[i]] &&
          dp2[i + 1] >= (int)(t).size() - pos[m][s[i]] - 1)
        r = m;
      if (dp1[i - 1] < pos[m][s[i]] &&
          dp2[i + 1] < (int)(t).size() - pos[m][s[i]] - 1) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (status[i] == true) continue;
    if (dp1[i - 1] >= pos[l][s[i]] &&
        dp2[i + 1] >= (int)(t).size() - pos[l][s[i]] - 1)
      status[i] = true;
    if (dp1[i - 1] >= pos[r][s[i]] &&
        dp2[i + 1] >= (int)(t).size() - pos[r][s[i]] - 1)
      status[i] = true;
    if (status[i] == false) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((int)(t).size() > (int)(s).size() || s[0] != t[0])
    cout << "No" << endl;
  else if (s[(int)(s).size() - 1] != t[(int)(t).size() - 1])
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
