Is it possible to perform a sequence frame animation without adding every frame?

I only know that the sequence frame animation should be executed like this, the code is as follows:

SpriteFrameCache::getInstance()->addSpriteFramesWithFile("a.plist");
	auto pSprite2 = Sprite::create();
	pSprite2->setPosition(500, 600);
	this->addChild(pSprite2,2);
	Vector<SpriteFrame*>list;
	list.reserve(2);
	list.pushBack(SpriteFrameCache::getInstance()->getSpriteFrameByName("10001.png"));
    list.pushBack(SpriteFrameCache::getInstance()->getSpriteFrameByName("10002.png"));
	auto pAnimation = Animation::createWithSpriteFrames(list, 0.2f, 1000);
	auto pAnimate = Animate::create(pAnimation);
	pSprite2->runAction(pAnimate);

I saw someone on the Internet saying that it can be executed without adding the following two lines of code, that is to say, change the code to this? Modified as follows:

SpriteFrameCache::getInstance()->addSpriteFramesWithFile("a.plist");
	auto pSprite2 = Sprite::create();
	pSprite2->setPosition(500, 600);
	this->addChild(pSprite2,2);
	Vector<SpriteFrame*>list;
	list.reserve(2);
	auto pAnimation = Animation::createWithSpriteFrames(list, 0.2f, 1000);
	auto pAnimate = Animate::create(pAnimation);
	pSprite2->runAction(pAnimate);

But this doesn’t work. How should it be modified?