#include <bits/stdc++.h>
using namespace std;
struct seqstr {
  int l, r;
  char c;
} seq[200200];
bool mark[200200];
string s1, s2;
bool cmp(seqstr s1, seqstr s2) {
  if (s1.c != s2.c) return s1.c < s2.c;
  return s1.l < s2.l;
}
int main() {
  cin >> s1;
  cin >> s2;
  int len1 = s1.length(), len2 = s2.length();
  bool flag = true;
  for (int i = 0; i < len2; i++) seq[i].c = s2[i];
  int p = 0, q = 0;
  while (p < len1) {
    if (s1[p] == s2[q])
      seq[q].l = p, p++, q++;
    else
      p++;
    if (q == len2) break;
  }
  if (q != len2) {
    cout << "No\n";
    return 0;
  }
  p = len1 - 1, q = len2 - 1;
  while (p >= 0) {
    if (s1[p] == s2[q])
      seq[q].r = p, p--, q--;
    else
      p--;
    if (q == -1) break;
  }
  if (flag == false || q != -1) {
    cout << "No\n";
    return 0;
  }
  sort(seq, seq + len2, cmp);
  int his = 0;
  for (int i = 0; i < len2; i++) {
    if (i == 0 || seq[i].c != seq[i - 1].c) his = 0;
    for (int j = max(his, seq[i].l); j <= seq[i].r; j++) {
      if (s1[j] == seq[i].c) mark[j] = true;
    }
    his = seq[i].r;
  }
  for (int i = 0; i < len1; i++)
    if (!mark[i]) {
      flag = false;
      break;
    }
  if (flag)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
