#include <bits/stdc++.h>
using namespace std;
char s1[200010], s2[200010];
int lo[200010], hi[200010];
int n, m;
vector<int> P[30];
bool bs(int l, int h, int x) {
  int s = 0, e = P[x].size() - 1;
  while (s <= e) {
    int m = (s + e) / 2;
    if (P[x][m] < l)
      s = m + 1;
    else if (P[x][m] > h)
      e = m - 1;
    else
      return 1;
  }
  return 0;
}
bool chk(int x) {
  if (P[s1[x] - 'a'].size() == 0) return 0;
  if (lo[x] > hi[x]) return 0;
  return bs(lo[x], hi[x], s1[x] - 'a');
}
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  n = strlen(s1 + 1);
  m = strlen(s2 + 1);
  for (int i = 1; i <= m; ++i) P[s2[i] - 'a'].push_back(i);
  for (int i = 0; i < 26; ++i) sort(P[i].begin(), P[i].end());
  hi[0] = 0;
  for (int i = 1; i <= n; ++i) {
    int j = hi[i - 1] + 1;
    hi[i] = hi[i - 1];
    if (s1[i] == s2[j]) hi[i]++;
  }
  lo[n + 1] = m + 1;
  for (int i = n; i >= 0; --i) {
    int j = lo[i + 1] - 1;
    lo[i] = lo[i + 1];
    if (s1[i] == s2[j]) lo[i]--;
  }
  for (int i = 1; i <= n; ++i)
    if (!chk(i)) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
  return 0;
}
