#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-10;
double EQ(double a, double b) { return abs(a - b) < EPS; }
void fast_stream() { std::ios_base::sync_with_stdio(0); }
template <class T>
string IntToString(T num) {
  string res;
  stringstream ss;
  ss << num;
  return ss.str();
}
long long StringToInt(string &str) {
  long long res = 0;
  for (int i = 0; i < (int)str.size(); i++) res = (res * 10 + str[i] - '0');
  return res;
}
int poss[1000001];
int poss2[1000001];
int info[30][500001];
int chs[30];
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size();
  int m = t.size();
  int tpos = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == t[tpos]) {
      poss[tpos++] = i;
    }
    if (tpos == m) break;
  }
  if (n < m || tpos != m) {
    cout << "No" << endl;
    return 0;
  }
  tpos = m - 1;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == t[tpos]) {
      poss2[tpos--] = i;
    }
    if (tpos < 0) break;
  }
  if (n < m || tpos >= 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = m - 1; i >= 0; i--) {
    if (i == m - 1) {
      int from = poss[i];
      int to = poss2[i] + 1;
      int ch = t[i] - 'a';
      info[ch][from]++;
      info[ch][to]--;
    } else {
      int from = poss[i];
      int to = poss2[i + 1];
      int ch = t[i] - 'a';
      info[ch][from]++;
      info[ch][to]--;
    }
  }
  for (int i = 0; i < n; i++) {
    int ch = s[i] - 'a';
    for (int j = 0; j < 30; j++) chs[j] += info[j][i];
    if (chs[ch] == 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
