#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010, maxm = 32;
string s, t;
int L[maxn], R[maxn], W[maxn];
bool valid() {
  memset(W, -1, sizeof(W));
  for (int i = 0; i < ((int)(s).size()); ++i) {
    if (L[i] != -1) W[t[L[i]] - 'a'] = L[i];
    if (W[s[i] - 'a'] == -1 || W[s[i] - 'a'] < R[i]) return 0;
  }
  return 1;
}
int main() {
  while (cin >> s >> t) {
    int k = 0;
    for (int i = 0; i < ((int)(s).size()); ++i) {
      if (k < ((int)(t).size()) && s[i] == t[k]) ++k;
      L[i] = k - 1;
    }
    k = ((int)(t).size()) - 1;
    for (int i = ((int)(s).size()) - 1; i >= 0; --i) {
      if (k >= 0 && s[i] == t[k]) --k;
      R[i] = k + 1;
    }
    if (valid())
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
