Hi Hamid,
I'm not sure if there could be an out-of-the-box solution to your problem. Import of contacts and accounts are two separate operations.
All documentation as well as other forum threads are confirming that you can import one record type at a time (lead/account/contact/...), eg
From the forum: How to link Accounts with Contacts during data import?
From Microsoft documentation: Import accounts, leads, or other data
Harish has provided a good reference, imho.
I don't see much difference in effort when doing it in one step or two (as filtering the original Excel file is an easy task) - but as you've written this post there are probably some specific in your case that we simply can't imagine from a short description here. Myself, I would do it that way:
1) filter Excel and save all Accounts
2) import accounts (and remove duplicates if needed)
3) filter Excel and save all Contacts
4) import contacts and link them to already created accounts (watch for the right column name for account)
But, if you need to make it one step, I suppose you can customize import functionality to implement the logic you need: checking " if account is in the Account then no action but if account is not in Accounts then it should be created and given in Contacts".
P.S. If you need an official confirmation on whether one step import for two record types is supported or not, I would recommend you creating a support ticket.
HTH
BR,
Elena