EX-23 5 nksh-ex23.htm EX-23

Exhibit 23

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We consent to the incorporation by reference in Registration Statement No. 333-272491 on Form S-8 of National Bankshares, Inc. of our report dated March 27, 2026, relating to the audit of the consolidated financial statements appearing in this Annual Report on Form 10-K of National Bankshares, Inc. for the year ended December 31, 2025.

/s/ Yount, Hyde & Barbour, P.C.

Winchester, Virginia
March 27, 2026