#include <bits/stdc++.h>
using namespace std;
int perf[300001], suff[300001];
char s1[300001], s2[300001];
vector<int> ind[30];
int len1, len2;
bool checksuff(int ind, int cnt) { return suff[ind] >= cnt; }
bool checkperf(int ind, int cnt) { return perf[ind] >= cnt; }
int binar(int id, char a) {
  int l = 0, r = ind[a - 'a'].size(), cnt1, cnt2;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (l == -1) mid = (r - l) / 2;
    cnt1 = ind[a - 'a'][mid];
    bool result = checkperf(id, cnt1);
    if (result)
      l = mid;
    else
      r = mid;
  }
  cnt1 = ind[a - 'a'][l];
  cnt2 = len2 - 1 - cnt1;
  if (checkperf(id, cnt1) and checksuff(id, cnt2)) return l;
  return -1;
}
int main() {
  scanf("%s %s", s1, s2);
  len1 = strlen(s1);
  len2 = strlen(s2);
  for (int i = 0; i < len2; i++) {
    ind[s2[i] - 'a'].push_back(i);
  }
  int cnt = len2 - 1;
  for (int i = len1 - 1; i >= 0; i--) {
    if (cnt >= 0 and s1[i] == s2[cnt]) cnt--, suff[i]++;
    suff[i] += suff[i + 1];
  }
  if (cnt != -1 or len1 < len2) {
    cout << "No";
    return 0;
  }
  cnt = 0;
  for (int i = 0; i < len1; i++) {
    if (cnt < len2 and s1[i] == s2[cnt]) cnt++, perf[i]++;
    if (i) perf[i] += perf[i - 1];
  }
  for (int i = 0; i < len1; i++) {
    if (ind[s1[i] - 'a'].size() == 0) {
      cout << "No";
      return 0;
    }
    int q = binar(i, s1[i]);
    if (q == -1) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
