\documentclass[a5paper,twoside]{jarticle}
\usepackage{fancyhdr}
\usepackage{xcolor}

\makeatletter
\def\headrule{{\color{red}\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
    \hrule\@height\headrulewidth\@width\headwidth
\vskip-\headrulewidth}}
\def\footrule{{\color{red}\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
    \hrule\@height\footrulewidth\@width\headwidth
\vskip-\footrulewidth}}
\makeatother

\pagestyle{fancy}

\fancyhead{} % clear all fields
\fancyhead[RE]{\large\bfseries No.\thepage}

\fancyfoot{}
\fancyfoot[LO]{From: YKK}
\fancyfoot[RE]{To: KKY}

\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\setlength{\headheight}{18pt}

\def\iroh{色は匂へど散りぬるを我が世誰ぞつねならむ
有為の奥山今日越えて浅き夢見じ酔ひもせず一二三}

\begin{document}

\begin{abstract}
\texttt{fancyhdr.sty}を試してみる。
\end{abstract}

\section{最初}

\iroh

\iroh

\iroh

\section{次}

\iroh

\iroh

\iroh

\section{その次}

\iroh

\newpage

\iroh

\iroh

\section{また、その次}

\iroh

\iroh
\newpage

\iroh

\section{また、その次}

\iroh

\iroh

\iroh

\end{document}
