#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
string s, t;
int first[200010], last[200010], fl, ll;
int ch[30][200010], chl[30], chf[30];
bool e[200010];
bool res;
bool getFirst() {
  int p = 0;
  int len1 = s.length();
  int len2 = t.length();
  for (int i = 0; i <= len1; i++) {
    if (i == len1 + 1) return 0;
    if (s[i] == t[p]) {
      fl++;
      first[fl] = i;
      p++;
    };
    if (p == len2) return 1;
  };
  return 1;
};
bool getLast() {
  int len1 = s.length();
  int len2 = t.length();
  int p = len2 - 1;
  for (int i = len1 - 1; i > -2; i--) {
    if (i == -1) return 0;
    if (s[i] == t[p]) {
      ll++;
      last[ll] = i;
      p--;
    };
    if (p == -1) return 1;
  };
  return 1;
};
void fill(char c, int l, int r) {
  int left = 1, right = chl[c];
  int pos1;
  pos1 = (1 + chl[c]) / 2;
  while (ch[c][pos1] != l) {
    if (ch[c][pos1] < l)
      left = pos1 + 1;
    else
      right = pos1 - 1;
    pos1 = (left + right) / 2;
  };
  left = 1;
  right = chl[c];
  int pos2 = (1 + chl[c]) / 2;
  while (ch[c][pos2] != r) {
    if (ch[c][pos2] < r)
      left = pos2 + 1;
    else
      right = pos2 - 1;
    pos2 = (left + right) / 2;
  };
  if (chf[c] > pos1) pos1 = chf[c];
  for (int i = pos1; i <= pos2; i++) e[ch[c][i]] = 1;
  chf[c] = pos2 + 1;
};
int main() {
  cin >> s >> t;
  int len1 = s.length();
  int len2 = t.length();
  for (int i = 0; i < len1; i++) s[i] -= 97;
  for (int i = 0; i < len2; i++) t[i] -= 97;
  for (int i = 0; i < 29; i++) chf[i] = 1;
  res = 1;
  res &= getFirst();
  res &= getLast();
  if (res) {
    for (int i = 0; i < len1; i++) {
      char c = s[i];
      chl[c]++;
      ch[c][chl[c]] = i;
    };
    int inv = len2;
    for (int i = 0; i < len2; i++) {
      fill(t[i], first[i + 1], last[inv]);
      inv--;
    };
  };
  for (int i = 0; i < len1; i++)
    if (e[i] == 0) {
      cout << "No";
      return 0;
    }
  cout << "Yes";
  return 0;
};
