You could treat file A as a string inside file B. Here's an example inspired by a comment on another question that uses YAML's literal style for strings:
B.yaml: |
- heading:
name: A name
taco: Yes
age: 32
- heading:
name: Another name
taco: No
age: 27
When loaded, you'll get a mapping from "B.yaml" to the text of file B. Just load this resulting text to get the data in the second file out.
Here's how it looks in Python, using PyYAML:
from pprint import pprint
import yaml
fileA = """
fileB: |
- heading:
name: A name
taco: Yes
age: 32
- heading:
name: Another name
taco: No
age: 27
"""
dataA = yaml.load(fileA)
dataB = yaml.load(dataA["fileB"])
pprint(dataA) # A mapping to the text of the inner file
pprint(dataB) # The data from that inner file