YARN stands for Yet Another Resource Negotiator. The critical function of Hadoop YARN is to supply the computational resources required for applications by distinguishing between resource management and job scheduling. For more details on this component, see YARN architecture.
Generally, hardware recommendations for a YARN Resource Manager machine are the same as for a NameNode. If happens that both NameNodes, primary and secondary, fail, you can always use the YARN Resource Manager node as a NameNode for a while.