#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 1; i < n; ++i) {
    if (s[i - 1] == 'A' && s[i] == 'C') {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  puts("No");
  return 0;
}

#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	
	for (int i=1; i<=n; i=i+1) {
		int x = i;
		if (x % 3 == 0) {
			cout << " " << i;
	 	} else {
			while (x % 10 != 3 && x > 0) {
				x = x / 10;
			}
			if (x % 10 == 3)
				cout << " " << i;
		}
	}
	cout << endl;

	return 0;
}
