#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cassert>
#include <algorithm>

using namespace std;

vector<int> a;
vector<int> sort_a;
vector<bool> ans;

bool check(int k)
{
	int suitable = 0;
	for (int i = 1; i <= k; i++)
		if (a[i] <= sort_a[k])
			suitable++;
	return suitable == k;
}

int main()
{
	ifstream in("cubics.in");
	ofstream out("cubics.out");
	
	int n;
	in >> n;
	assert(n > 0 && n <= 300000);
	
	
	int tmp;
	a.push_back(-1);
	sort_a.push_back(-1);
	for (int i = 0; i < n; i++)
	{
		in >> tmp;
		assert(tmp > 0 && tmp <= 1000000000);
		a.push_back(tmp);
		sort_a.push_back(tmp);
	}

	
	ans = vector<bool>(n + 1, false);
	int result = 0;
    sort(sort_a.begin(), sort_a.end());
	for (int i = 1; i < n; i++)
		if (check(i))
		{
			result ++;
			ans[i] = true;
		}

	out << result << '\n';
	for (int i = 1; i <= n - 1; i++)
	{
		if (ans[i])
			out << i << " ";
	}
	
	return 0;
}
