أَخْبَرَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ، قَالَ حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، قَالَ حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ حَمَّادٍ، عَنْ إِبْرَاهِيمَ، عَنِ الأَسْوَدِ، عَنْ عَائِشَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ رُفِعَ الْقَلَمُ عَنْ ثَلاَثٍ عَنِ النَّائِمِ حَتَّى يَسْتَيْقِظَ وَعَنِ الصَّغِيرِ حَتَّى يَكْبُرَ وَعَنِ الْمَجْنُونِ حَتَّى يَعْقِلَ أَوْ يَفِيقَ ‏"‏ ‏.‏

It was narrated from 'Aishah that the Prophet said: "The pen has been lifted from three: From the sleeper until he wakes up, from the minor until he grows up, and from the insane until he comes back to his senses or recovers." Translation Not Available

Book Ref: Sunan An Nisai Book 27 Hadith 3432
Web Ref:  Sunan An Nisai Vol 4 Book 27 Hadith 3462