#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * (int)1e5 + 10;
int pos[maxn], last[maxn][27];
int tree[maxn + 10][27];
char s[maxn], t[maxn];
void update(int x, int v, int k) {
  ++x;
  for (; x < maxn; x += x & -x) tree[x][k] += v;
}
int read(int x, int k) {
  int ret = 0;
  ++x;
  for (; x > 0; x -= x & -x) ret += tree[x][k];
  return ret;
}
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s);
  int m = strlen(t);
  int p = 0;
  for (int i = 0; i < n; ++i) {
    if (p < m && s[i] == t[p]) {
      pos[p++] = i;
    }
    for (int j = 0; j < 26; ++j)
      if (i) last[i][j] = last[i - 1][j];
    last[i][s[i] - 'a'] = i;
  }
  if (p < m) {
    printf("No\n");
    return 0;
  }
  int next = last[n - 1][t[m - 1] - 'a'];
  for (int i = m - 1; i >= 0; --i) {
    int now = pos[i];
    update(now, 1, t[i] - 'a');
    update(next + 1, -1, t[i] - 'a');
    if (next) next = last[next - 1][t[i - 1] - 'a'];
  }
  bool ok = 1;
  for (int i = 0; i < n && ok; ++i)
    if (read(i, s[i] - 'a') == 0) ok = 0;
  if (ok)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
