#include <bits/stdc++.h>
using namespace std;
void task();
int main() {
  srand(time(0));
  task();
  return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 10;
const int M = 1e5 + 10;
int n, m;
string s;
string t;
char buf[N];
int l[N];
int r[N];
vector<int> v[256];
void task() {
  buf[0] = '!';
  scanf("%s", buf + 1);
  s = buf;
  scanf("%s", buf);
  t = buf;
  n = s.length() - 1;
  s += "!";
  m = t.length();
  for (int i = 1; i <= n; ++i) {
    l[i] = l[i - 1];
    if (l[i] < m && t[l[i]] == s[i]) ++l[i];
  }
  for (int i = 0; i < m; ++i) v[t[i]].push_back(i);
  for (int i = 'a'; i <= 'z'; ++i) v[i].push_back(INF);
  for (int i = n; i >= 1; --i) {
    r[i] = r[i + 1];
    if (r[i] < m && t[m - r[i] - 1] == s[i]) ++r[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (upper_bound((v[s[i]].begin()), (v[s[i]].end()), l[i - 1]) <=
        lower_bound((v[s[i]].begin()), (v[s[i]].end()), m - r[i + 1] - 1)) {
      printf("No");
      return;
    }
  }
  printf("Yes");
}
